Here you can find the source of asString(byte[] buf)
private static String asString(byte[] buf)
//package com.java2s; public class Main { private static String asString(byte[] buf) { StringBuffer strbuf = new StringBuffer(buf.length); for (int i = 0; i < buf.length; i++) { strbuf.append((char) buf[i]); }/*from w ww .j a v a 2 s.c o m*/ return strbuf.toString(); } }