BinaryUtils { public static String toHex(byte[] data) { return Base16Lower.encodeAsString(data); }  static String toHex(byte[] data); static byte[] fromHex(String hexData); static String toBase64(byte[] data); static byte[] fromBase64(String b64Data); static ByteArrayInputStream toStream(ByteBuffer byteBuffer); static byte[] copyAllBytesFrom(ByteBuffer bb); static byte[] copyBytesFrom(ByteBuffer bb);  }
@Test public void testHex() { { String hex = BinaryUtils.toHex(new byte[] {0}); System.out.println(hex); String hex2 = Base16Lower.encodeAsString(new byte[] {0}); assertEquals(hex, hex2); } { String hex = BinaryUtils.toHex(new byte[] {-1}); System.out.println(hex); String hex2 = Base16Lower.encodeAsString(new byte[] {-1}); assertEquals(hex, hex2); } }