Here you can find the source of byteTo16String(byte[] bt)
public static String byteTo16String(byte[] bt)
//package com.java2s; /**/* w w w.j ava 2 s . c om*/ * * Methods Descrip:Converts a line of text into an array of lower case words * using a BreakIterator.wordInstance(). * <p> * * This method is under the Jive Open Source Software License and was * written by Mark Imbriaco. * * @param text * a String of text to convert into an array of words * @return text broken up into an array of words. * */ public class Main { public static String byteTo16String(byte[] bt) { String res = ""; for (int i = 0; i < bt.length; i++) { int hex = (int) bt[i] & 0xff; System.out.print(Integer.toHexString(hex) + " "); res = res + Integer.toHexString(hex); } return res; } }