Here you can find the source of bytesToStr(byte[] input)
public static String bytesToStr(byte[] input)
//package com.java2s; //License from project: Apache License public class Main { public static String bytesToStr(byte[] input) { String res = ""; for (byte b : input) { res += byteToStr(b);//from w w w. ja va 2 s .co m } return res; } private static String byteToStr(byte input) { String res = Integer.toHexString(input & 0xff); if (res.length() < 2) { res = "0" + res; } return res; } }