Android Hex String Create toHexString(byte oneByte)

Here you can find the source of toHexString(byte oneByte)

Description

to Hex String

Declaration

public static String toHexString(byte oneByte) 

Method Source Code

//package com.java2s;

public class Main {

    public static String toHexString(byte[] bytes) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < bytes.length; i++) {
            sb.append(toHexString(bytes[i]));
        }//from ww  w .j  a  v a 2s .c  om

        return sb.toString();
    }

    public static String toHexString(byte oneByte) {
        return String.format("%02x", oneByte);
    }
}

Related

  1. toHex(int address)
  2. toHexByte(String str, int offset, int length)
  3. toHexChar(int i)
  4. toHexDigits(byte theByte)
  5. toHexDigits(byte[] bytes)
  6. bt64ToHex(int[] byteData)