@Test public void testDoubleDigits() { byte a10 = 0x10; byte a20 = 0x20; byte a35 = 0x35; byte a4A = 0x4A; byte a5F = 0x5F; String str10 = Strings.byteToUnsignedHexString(a10); String str20 = Strings.byteToUnsignedHexString(a20); String str35 = Strings.byteToUnsignedHexString(a35); String str4A = Strings.byteToUnsignedHexString(a4A); String str5F = Strings.byteToUnsignedHexString(a5F); Assert.assertTrue(str10.equals("0x10")); Assert.assertTrue(str20.equals("0x20")); Assert.assertTrue(str35.equals("0x35")); Assert.assertTrue(str4A.equals("0x4A")); Assert.assertTrue(str5F.equals("0x5F")); }
public static String byteToUnsignedHexString(byte b) { int value = b; value &= 0xFF; return ( value < 16 ? "0x0" + toUpperCase(Integer.toHexString(value)) : "0x" + toUpperCase(Integer.toHexString(value))); }
Strings { public static String byteToUnsignedHexString(byte b) { int value = b; value &= 0xFF; return ( value < 16 ? "0x0" + toUpperCase(Integer.toHexString(value)) : "0x" + toUpperCase(Integer.toHexString(value))); } }
Strings { public static String byteToUnsignedHexString(byte b) { int value = b; value &= 0xFF; return ( value < 16 ? "0x0" + toUpperCase(Integer.toHexString(value)) : "0x" + toUpperCase(Integer.toHexString(value))); } private  Strings(); }
Strings { public static String byteToUnsignedHexString(byte b) { int value = b; value &= 0xFF; return ( value < 16 ? "0x0" + toUpperCase(Integer.toHexString(value)) : "0x" + toUpperCase(Integer.toHexString(value))); } private  Strings(); static String byteToUnsignedHexString(byte b); static String bytesToHex(byte[] bytes); static String toUpperCase(String str); static String toLowerCase(String str); static int convertPollingIntervalString(String pollingInterval); }
Strings { public static String byteToUnsignedHexString(byte b) { int value = b; value &= 0xFF; return ( value < 16 ? "0x0" + toUpperCase(Integer.toHexString(value)) : "0x" + toUpperCase(Integer.toHexString(value))); } private  Strings(); static String byteToUnsignedHexString(byte b); static String bytesToHex(byte[] bytes); static String toUpperCase(String str); static String toLowerCase(String str); static int convertPollingIntervalString(String pollingInterval);  }