long position = 0;
int bitOffset = 0;
int operation = 0;
final ByteBuffer buffer = ByteBuffer.allocate(128);
final Random random = TestUtilities.createRandomNumberGenerator("testWithRandomData");
final ByteOrder byteOrder = random.nextBoolean() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
final byte[] data = ChannelDataInputTest.createRandomArray(512 * 1024, random);
final ImageInputStream r = ImageIO.createImageInputStream(new ByteArrayInputStream(data));
final ImageInputStream t = new ChannelImageInputStream("Test data",
Channels.newChannel(new ByteArrayInputStream(data)), buffer, false);
try {