Java Memory leaks with FileChannel

It is a myth that Java has no ‘memory leaks’. It is certainly much better than developing in C and many of the gotchas do not exist in Java. But there are still potential memory issues in Java. For example, we have been looking at using FileChannel. This allows the developer to have only part…

Read More

Saving Java images as Tifs wth JAI

Java makes it very easy to create images as BufferedImages which¬† can then be saved out in standard image file formats. Here is the code to save an image as a Tif image using the JAI image (a free library from Sun). com.sun.media.jai.codec.TIFFEncodeParam params = new com.sun.media.jai.codec.TIFFEncodeParam(); FileOutputStream os = new FileOutputStream(outputDir + imageName+”.tif”); javax.media.jai.JAI.create(“encode”,…

Read More

Open Source licensing

Update: Since writing this article, we have changed the license used for JPedal from GPL to LGPL. This means you can use the unsupported Open Source version of JPedal in any software. The article itself is still very relevent to Open Source software in general. We found a site belonging to a major University in…

Read More

Odd coloured JPEGs in Java with ImageIO

One of the best features about Java is the amount of low-level complexity it removes, allowing you to focus on developing the application. However, this does sometimes hide some important issues. We found one of these with the ImageIO class which offers a whole series of methods to save an image as a Tiff, a…

Read More