Here you can find the source of printByteArray(byte b[])
public static String printByteArray(byte b[])
//package com.java2s; //License from project: Open Source License public class Main { public static String printByteArray(byte b[]) { String str = ""; for (int i = 0; i < b.length; i++) { char c = (char) b[i]; str = (new StringBuilder(String.valueOf(str))).append(c).toString(); }// w w w. j a v a 2 s .co m return str; } }