package com.lxb.test;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class ByteArrayStreamDemo {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
ByteArrayInputStream bis=new ByteArrayInputStream("e:\\demo.txt".getBytes());
ByteArrayOutputStream bos=new ByteArrayOutputStream();
int len=0;
while((len=bis.read())!=-1) {
bos.write(len);
}
System.out.println(bos.toString());
bos.close();
}
}
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class ByteArrayStreamDemo {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
ByteArrayInputStream bis=new ByteArrayInputStream("e:\\demo.txt".getBytes());
ByteArrayOutputStream bos=new ByteArrayOutputStream();
int len=0;
while((len=bis.read())!=-1) {
bos.write(len);
}
System.out.println(bos.toString());
bos.close();
}
}