@Test public void testHex() { byte A = 10; byte B = 11; byte C = 12; byte D = 13; byte E = 14; byte F = 15; String strA = Strings.byteToUnsignedHexString(A); String strB = Strings.byteToUnsignedHexString(B); String strC = Strings.byteToUnsignedHexString(C); String strD = Strings.byteToUnsignedHexString(D); String strE = Strings.byteToUnsignedHexString(E); String strF = Strings.byteToUnsignedHexString(F); Assert.assertTrue(strA.equals("0x0A")); Assert.assertTrue(strB.equals("0x0B")); Assert.assertTrue(strC.equals("0x0C")); Assert.assertTrue(strD.equals("0x0D")); Assert.assertTrue(strE.equals("0x0E")); Assert.assertTrue(strF.equals("0x0F")); }
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);  }