byte[] bytes = {2, 3, 4};
bm.writeBytes(bytes);
bm.writeBytes(bytes);
bm.reset();
byte[] result = new byte[2];
int len = bm.readBytes(result);
assertEquals(2, len);
len = bm.readBytes(result);
assertEquals(1, len);
len = bm.readBytes(result);
assertEquals(2, len);