ByteArrayOutputStream buffer = new ByteArrayOutputStream();
UnsafeOutput output = new UnsafeOutput(buffer, 2);
output.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
output.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
output.writeBytes(new byte[] {51, 52, 53, 54, 55, 56, 57, 58});
output.writeBytes(new byte[] {61, 62, 63, 64, 65});
output.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, //