BufferedOutputStream输出不完整?
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class Text{
public static void main(String[] args) throws IOException{
byte[] buf = new byte[1024];
FileInputStream input = new FileInputStream("D:\\Text\\Class\\Test.java");
BufferedInputStream bufferinput = new BufferedInputStream(input);
FileOutputStream output = new FileOutputStream("D:\\Text\\new_test.txt");
BufferedOutputStream bufferoutput = new BufferedOutputStream(output);
while( bufferinput.read(buf) != -1){
bufferoutput.write(buf,0,buf.length);
}
bufferoutput.flush();
bufferoutput.close();
output.close();
bufferinput.close();
input.close();
System.out.println("已结束!");
}
}
原文档是但输出只,读读到最后continue那,后面的分号及最后的几个}都没有,为什么? |
免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。
版权声明:作者保留权利,不代表天盟立场。
|
|
|
|