Exemplo n.º 1
0
 @Test
 public void serializeIntAsHexAsciiBytesLeftPaddedWithTwoZeroes() throws Exception {
   ByteArrayOutputStream out = new ByteArrayOutputStream(20);
   AsciiUtils.writeIntAsHexAsciiBytes(10, out, 2);
   byte[] expecteds = new byte[] {'0', 'A'};
   assertArrayEquals(expecteds, out.toByteArray());
   out.reset();
   AsciiUtils.writeIntAsHexAsciiBytes(27, out, 2);
   expecteds = new byte[] {'1', 'B'};
   assertArrayEquals(expecteds, out.toByteArray());
 }