// create a BufferedImage of the appropriate type
int w = buffer.getWidth();
int h = buffer.getHeight();
final ImageTranscoder trans = new TIFFTranscoder();
trans.addTranscodingHint
(TIFFTranscoder.KEY_XML_PARSER_CLASSNAME,
application.getXMLParserClassName());
final BufferedImage img = trans.createImage(w, h);
// paint the buffer to the image