1. 程式人生 > >模擬javaweb項目中的相似報錯

模擬javaweb項目中的相似報錯

模擬 java nat ray com div arraycopy bis exce

BufferedInputStream bis = new BufferedInputStream(new FileInputStream("shabi.mp3"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("qiucao.mp3"));
int b;
while((b=bis.read())!= -1){
bos.write(b);
bos.close();
}

Exception in thread "main" java.io.IOException: Stream Closed
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:345)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:95)
at com.leaderfar.stream.Demo4_arrayCopy.main(Demo4_arrayCopy.java:26)

第一次寫完流就已經關掉了 關完之後有想去寫 就沒法寫了 流都已經關掉了 就不能寫了

模擬javaweb項目中的相似報錯