Android Byte Array to Hex Convert byteArrayToHexString(byte[] array)

Here you can find the source of byteArrayToHexString(byte[] array)

Description

byte Array To Hex String

License

Open Source License

Declaration

public static String byteArrayToHexString(byte[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String byteArrayToHexString(byte[] array) {
        StringBuffer hexString = new StringBuffer();
        for (byte b : array) {
            int intVal = b & 0xff;
            if (intVal < 0x10)
                hexString.append("0");
            hexString.append(Integer.toHexString(intVal));
        }//from   w ww.  j  a va2s .co  m
        return hexString.toString();
    }
}

Related

  1. convertToHex(byte[] data)
  2. convertToHexString(byte[] b)
  3. encodeHex(byte[] data)
  4. encodeHex(byte[] data)
  5. convertToHex(byte[] data)
  6. byteArrayToHexString(byte[] b)
  7. byteArrayToHexString(byte[] byteArray)