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

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

Description

byte Array To Hex String

License

Open Source License

Declaration

public static String byteArrayToHexString(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {
    public static String byteArrayToHexString(byte[] b) {
        String result = "";
        for (int i = 0; i < b.length; i++) {
            result += Integer.toString((b[i] & 0xff) + 0x100, 16)
                    .substring(1);/*  www  . j a  va2s .co  m*/
        }
        return result;
    }
}

Related

  1. getHexStringOfByte(byte[] bytes)
  2. bytesToHexString(byte[] bytes)
  3. bytesToHexString(byte[] bytes)
  4. convertToHex(byte[] data)
  5. toHex(final byte[] bytes)
  6. toHexString(byte abyte0[], int beginIndex, int endIndex, boolean spaceFlag)
  7. toHexString(byte abyte0[], int beginIndex, int endIndex)
  8. toHexString(byte abyte0[], boolean spaceFlag)
  9. toHexString(byte abyte0[])