Android Hex String Create hexify(byte bytes[])

Here you can find the source of hexify(byte bytes[])

Description

hexify

License

Apache License

Declaration

private static String hexify(byte bytes[]) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static String hexify(byte bytes[]) {
        char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
                '9', 'a', 'b', 'c', 'd', 'e', 'f' };

        StringBuffer buf = new StringBuffer(bytes.length * 2);
        for (int i = 0; i < bytes.length; ++i) {
            buf.append(hexDigits[(bytes[i] & 0xf0) >> 4]);
            buf.append(hexDigits[bytes[i] & 0x0f]);
        }//from www. j av  a 2s .co  m
        return buf.toString();
    }
}

Related

  1. encodeHex(byte[] pData)
  2. hex(int value, int digits)
  3. hexCharToInt(char c)
  4. hexDecode(String str, byte[] ba, int len)
  5. hexEncode(byte[] aInput)
  6. toHex(String str)
  7. toHex(String txt)
  8. toHex(byte b)
  9. toHex(byte input[])