Java tutorial
//package com.java2s; import java.io.ByteArrayInputStream; public class Main { /** * @param b * @return */ public static String getShi(byte[] buf) { StringBuilder builder = new StringBuilder(); ByteArrayInputStream input = new ByteArrayInputStream(buf); int i = 0; while ((i = input.read()) != -1) { builder.append(i); } return builder.toString(); } }