为什么文件复制不了呢?
程序代码:
import *; public class TestReader{ public static void main(String args[]) { FileReader in = null; FileWriter out = null; int b=0 ; try{ in = new FileReader("e:/java/io/TestOutputStream.java"); out= new FileWriter("e:/java/io/test/outFile.dat"); while(((b=in.read()) != -1)){ out.write(b); System.out.print((char)b); } in.close(); System.out.println("文件复制成功!"); }catch(FileNotFoundException e){ System.out.println("找不到文件"); }catch(IOException Ee){ System.out.println("文件复制失败"); } } }能够正常运行`、
为什么创建出来的outFile.dat文件是空的呢`
TestOutputStream.java文件里面有东西的啊`
是out.write(b);这个语句写错了么?