Category Archives: Java

Setting Eclipse and Java application JVM heap size on Mac OS X

The other day I kept on getting annoying “out of heap space” errors in Eclipse while running a memory intensive Java application I had written and it took a bit of searching to find the answer, so I thought I’d make a quick screencast that demonstrates how to increase the heap size of the JVM [...]

Lightweight SWF Header Reader (Java) II

After discovering how to compress / decompress swf files via the Java Deflater / Inflater api, I’ve abandoned the RandomAccessFile method of reading the swf and moved to just using a FileInputStream to create a byte array which can then be examined byte by byte, or, in some cases, bit by bit. The end result [...]

Decompressing A SWF With Java

This example reads a swf file into a byte array and decompresses / inflates all of the bytes of the swf except for the the first 8 bytes which are always uncompressed. As most swf files have zlib compression applied, file decompression is necessary if you wish to fully parse the swf. As with the [...]

Compressing A SWF With Java

The title pretty much says it all–this code sample illustrates how to compress a swf file using the Java Deflater class to perform the zlib compression on all the bytes of the swf except for the first 8 bytes which are always uncompressed. This class isn’t intelligent in the sense that it doesn’t check to [...]

Lightweight SWF Header Reader (Java)

One of the cool things about working for TechSmith is I’ve become interested in some of the *lower* level aspects of the Flash platform—namely the swf file format spec. So with the customary confidence of a programmer with a Political Science degree I set off to see if I could parse the swf header to [...]