Java Byte to Hex byteToHex(byte b, StringBuffer buf)

Here you can find the source of byteToHex(byte b, StringBuffer buf)

Description

byte To Hex

License

Open Source License

Declaration

private static void byteToHex(byte b, StringBuffer buf) 

Method Source Code

//package com.java2s;

public class Main {
    private static void byteToHex(byte b, StringBuffer buf) {
        char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
        int high = ((b & 0xf0) >> 4);
        int low = (b & 0x0f);
        buf.append(hexChars[high]);/*from  w ww . j a  v a2  s .co m*/
        buf.append(hexChars[low]);
    }
}

Related

  1. byteToHex(byte b)
  2. byteToHex(byte b)
  3. byteToHex(byte b)
  4. byteToHex(byte b)
  5. byteToHex(byte b)
  6. byteToHex(byte bytevalue)
  7. ByteToHex(byte byyte)
  8. byteToHex(byte c)
  9. byteToHex(byte[] bytes)