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

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

Description

Convert Hex String

Declaration

public static String ConvertHexString(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {
    public static String ConvertHexString(byte[] b) {
        String a = "";
        for (int i = 0; i < b.length; i++) {
            String hex = Integer.toHexString(b[i] & 0xFF);
            if (hex.length() == 1) {
                hex = '0' + hex;
            }/*from  w w w.  ja  v a  2  s. c  om*/

            a = a + hex;
        }

        return a;
    }
}

Related

  1. toHex(byte[] b)
  2. bytesToHexString(byte[] bytes)
  3. hexToHexString(byte[] b)
  4. toHexString(byte[] b)
  5. bytesToHexString(byte[] src)
  6. getHexStringOfByte(byte[] bytes)
  7. bytesToHexString(byte[] bytes)
  8. bytesToHexString(byte[] bytes)
  9. convertToHex(byte[] data)