import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; public class Test { public static void main(String[] args) throws IOException { ByteArrayInputStream bis = new ByteArrayInputStream("abcedf".getBytes()); ByteArrayOutputStream bos = new ByteArrayOutputStream(); int ch = 0; while((ch=bis.read())!=-1){ bos.write(ch); } System.out.println(bos.toString()); } }
ByteArrayInputStream与ByteArrayOutputStream_操作数组的流,布布扣,bubuko.com
ByteArrayInputStream与ByteArrayOutputStream_操作数组的流
原文:http://www.cnblogs.com/LO-ME/p/3599635.html