is, scanlineBytecounts[index],
"PSD: Missing Image Data");
final byte[] unpacked = new PackBits().decompress(packed, width);
final InputStream bais = new ByteArrayInputStream(unpacked);
final MyBitInputStream mbis = new MyBitInputStream(bais, ByteOrder.BIG_ENDIAN);
BitsToByteInputStream bbis = null;
boolean canThrow = false;
try {
bbis = new BitsToByteInputStream(mbis, 8); // we want all samples to be bytes
final int[] scanline = bbis.readBitsArray(depth, width);