@Test public void testToHexFromByte(){ byte data = 45; String hexData=BinToHex.toHexFromByte(data); Assert.assertEquals("2d", hexData); }
public static String toHexFromByte(final byte b) { byte leftSymbol = (byte)((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte)(b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); }
BinToHex { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte)((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte)(b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } }
BinToHex { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte)((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte)(b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); }  }
BinToHex { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte)((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte)(b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); }  static String toHexFromByte(final byte b); static String toHexFromBytes(final byte[] bytes); static byte[] readFile(File file); static void main(final String[] args); }
BinToHex { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte)((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte)(b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); }  static String toHexFromByte(final byte b); static String toHexFromBytes(final byte[] bytes); static byte[] readFile(File file); static void main(final String[] args); final static int BITS_PER_HEX_DIGIT; }