Exemplo n.º 1
0
 @Test
 public void serializeByteArrayAsHexAsciiBytes() throws Exception {
   final byte[] bytes =
       new byte[] {(byte) 0x00, (byte) 0x01, (byte) 0xAB, (byte) 0xCD, (byte) 0xEF};
   ByteArrayOutputStream out = new ByteArrayOutputStream(20);
   AsciiUtils.writeByteArrayAsHexAsciiBytes(bytes, out);
   final byte[] expecteds = new byte[] {'0', '0', '0', '1', 'a', 'b', 'c', 'd', 'e', 'f'};
   assertArrayEquals(expecteds, out.toByteArray());
 }