请问,代码中是哪里有问题吗? 拷贝后的word文件打不开,报错,buff这个变量,read(buff)之后,读的字节并没有赋给谁,那write(buff)也是写的buff,可是读的内容并没有赋给buff呀,是怎么能写出去呢,难道write能识别刚读进内存中的字节吗,懵,求指点,此word文档中有图片,难道是因为这吗?可是字节流可以读图片吧?
```java
package outputstream;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
/**
* @author 小池
* @version 1.0
*/
public class BufferedOutputStreamCopy {
public static void main(String[] args) throws Exception {
int readLen = 0;
byte[] buff = new byte[1024];
String orgPath = "D:\\java八股文.docx";
String destPath = "D:\\java八股文副本.docx";
BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(orgPath));
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(destPath));
while ((readLen = bufferedInputStream.read(buff)) != -1) {
bufferedOutputStream.write(buff, 0, readLen);
}
if (bufferedInputStream != null) {
bufferedInputStream.close();
}
if (bufferedOutputStream != null) {
bufferedOutputStream.close();
}
}
}
```