使用ByteArrayInputStream读取字节数组
//来 自 nowjava import java.io.ByteArrayInputStream; public class Main { public static void main(String[] args) { String str = "this is a test Example!"; byte[] bytes = str.getBytes(); ByteArrayInputStream bai = new ByteArrayInputStream(bytes); int ch; while ((ch = bai.read()) != -1) { System.out.print((char) ch); }//来 自 时 代 J a v a } }