Here you can find the source of byteArrayToHexString(byte[] bytes)
public static String byteArrayToHexString(byte[] bytes)
//package com.java2s; //License from project: Apache License import java.util.Formatter; public class Main { public static String byteArrayToHexString(byte[] bytes) { @SuppressWarnings("resource") Formatter fmt = new Formatter(new StringBuilder(bytes.length * 2)); for (byte b : bytes) { fmt.format("%02x", b); }//w w w. j a v a 2 s . c o m return fmt.toString(); } }