Java Byte Array to Hex bytesToHex(byte[] b)

Here you can find the source of bytesToHex(byte[] b)

Description

bytes To Hex

License

Open Source License

Declaration

public static String bytesToHex(byte[] b) 

Method Source Code

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

public class Main {
    public static String bytesToHex(byte[] b) {
        String result = "";
        for (int i = 0; i < b.length; i++) {
            result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);
        }/*from  w  w  w.j  a  v  a2 s  .  c o m*/
        return result;
    }
}

Related

  1. bytesToHex(byte... bytes)
  2. bytesToHex(byte[] a)
  3. bytesToHex(byte[] a)
  4. bytesToHex(byte[] array)
  5. bytesToHex(byte[] b)
  6. bytesToHex(byte[] b)
  7. bytesToHex(byte[] b)
  8. bytesToHex(byte[] b, int offset, int length)
  9. bytesToHex(byte[] binary)