标签:fileinput nbsp output while string rgs stream ring static
public class OutputStreamTest{
public static void main(String[] args){
streamCopy();
streamArrayCopy();
}
public static void streamCopy(){
InputStream input=new FileInputStream("xxx.txt");
OutputStream output=new FilmOutputStream("sss.txt");
int tem;
where((tem=input.read())!=-1){
output.write(tem);
}
output.close();
input.close();
}
public static void streamArrayCopy(){
InputStream input=new FileInputStream("xxx.txt");
OutputStream output=new FileOutputStream("sss.txt");
int tem;
byte[] by=new byte[1024];
while((tem=input.read(by))!=-1){
output.write(by,0,tem);
}
input.close();
output.close();
}
}
标签:fileinput nbsp output while string rgs stream ring static
原文地址:https://www.cnblogs.com/li19941999/p/10372413.html