}
@SuppressWarnings("resource")
protected BufferedImage decompressFrame(ImageInputStream iis, int index)
throws IOException {
SegmentedInputImageStream siis =
new SegmentedInputImageStream(iis, pixeldataFragments, index);
decompressor.setInput(patchJpegLS != null
? new PatchJPEGLSImageInputStream(siis, patchJpegLS)
: siis);
readParam.setDestination(bi);
long start = System.currentTimeMillis();
bi = decompressor.read(0, readParam);
long end = System.currentTimeMillis();
if (LOG.isDebugEnabled())
LOG.debug("Decompressed frame #{} 1:{} in {} ms",
new Object[] {index + 1,
(float) sizeOf(bi) / siis.getStreamPosition(),
end - start });
return bi;
}