int blockSize = computeTileSize(block);
IIOByteBuffer buf = new IIOByteBuffer(null, 0, 0);
source.readBytes(buf, size);
if (size < blockSize) {
cm.decompress(buf, block);
if (buf.getLength() < blockSize) {
throw new RuntimeException("Undersized block");
}
}
f.write(buf.getData(), buf.getOffset(), buf.getLength());