* @param aOutStream OutputStream to output the image to
* @throws FormatIOException
*/
public void write(BufferedImage aImage, OutputStream aOutStream) throws FormatIOException {
ImagePlus imagePlus = new ImagePlus("tempTif", aImage);
TiffEncoder encoder = new TiffEncoder(imagePlus.getFileInfo());
BufferedOutputStream bufStream = new BufferedOutputStream(aOutStream);
DataOutputStream out = new DataOutputStream(bufStream);
try {
encoder.write(out);
} catch (IOException e) {
LOGGER.error(e.getMessage(), e);
throw new FormatIOException(e.getMessage(), e);
}
}