System.arraycopy(temp, 512, temp2, 0, count);
assertEquals(bytes, temp2);
}
public void testWriteBytes () throws IOException {
UnsafeOutput buffer = new UnsafeOutput(512);
buffer.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
buffer.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
buffer.writeByte(51);
buffer.writeBytes(new byte[] {52, 53, 54, 55, 56, 57, 58});
buffer.writeByte(61);
buffer.writeByte(62);
buffer.writeByte(63);
buffer.writeByte(64);
buffer.writeByte(65);
buffer.flush();
assertEquals(new byte[] { //
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, //
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, //
51, 52, 53, 54, 55, 56, 57, 58, //
61, 62, 63, 64, 65}, buffer.toBytes());
}