int interleave = (subtype >> 0) & 0xff;
int chroma = (subtype >> 8) & 0xff;
int conversion = (subtype >> 16) & 0xff;
int table = (subtype >> 24) & 0xff;
JPEGImageDecoder dec;
JPEGDecodeParam param = null;
if (table != 0) {
InputStream tableStream =
new ByteArrayInputStream(JPEGTable[table]);
dec = JPEGCodec.createJPEGDecoder(tableStream);
Raster junk = dec.decodeAsRaster();
param = dec.getJPEGDecodeParam();
}
subimageDataStream.seek(getTileOffset(tileIndex));
if (param != null) {
dec = JPEGCodec.createJPEGDecoder(subimageDataStream, param);
} else {
dec = JPEGCodec.createJPEGDecoder(subimageDataStream);
}
Raster ras = dec.decodeAsRaster().createTranslatedChild(tx, ty);
DataBufferByte dataBuffer = (DataBufferByte)ras.getDataBuffer();
byte[] data = dataBuffer.getData();
int subimageColorType = subimageColor[resolution][0] >> 16;