public static void main(String[] args) {
// TODO Auto-generated method stub
FileOutputStream fos = null;
FileInputStream fis = null;
try {
fos = new FileOutputStream("E:\\3.jsp");
fis = new FileInputStream("D:\\1.jsp");
byte[] buf = new byte[10242222];
int len = 0;
while ((len = fis.read(buf))!= -1) {
fos.write(buf, 0, len);
}
} catch (IOException e) {
// TODO: handle exception
//throw new RuntimeException("复制文件失败");
为什么拷贝txt文件,就可以成功拷贝,拷贝图片就失败呢,拷贝过去的图片无法打开,并且是0字节的 |