int index = channel * height + y;
byte packed[] = bfp.readByteArray("scanline",
scanline_bytecounts[index], is,
"PSD: Missing Image Data");
byte unpacked[] = new PackBits().decompress(packed, width);
InputStream bais = new ByteArrayInputStream(unpacked);
MyBitInputStream mbis = new MyBitInputStream(bais,
BYTE_ORDER_MSB);
BitsToByteInputStream bbis = new BitsToByteInputStream(mbis, 8); // we want all samples to be bytes
int scanline[] = bbis.readBitsArray(depth, width);