Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Mar 1, 2013

InputStream vs. InputStreamReader

Came across this lovely gem. When reading a binary stream in Java, don't use an InputStreamReader. The issue I ran into is when casting a read() into a byte, the value wasn't always what it should be. Luckily when I ran the checksum it failed, otherwise I problably would have never realized this. Reading the start of each packet was working, as did reading the expected number of bytes after the start of the packet. "Works" is a loose term, it was returning data, just not what I expected.

Feb 22, 2013

JD GUI

Came across this gem. Rather than fire up eclipse (although it's running most of the time anyway), if you need to quickly view the decompiled java source, there's a free tool called JD-GUI. It's fairly small, offers search capabilities and is very fast. It accepts a class file or a jar file, which is very convenient.

Grab a copy here: http://java.decompiler.free.fr/?q=jdgui