求大神指点下面这段程序怎么写了,文件是创建了。可文件里面是空的,为什么?????
public static void main(String[] args) throws IOException {
BufferedInputStream is = new BufferedInputStream(new FileInputStream("c://aaaa.txt"));
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream("c://bbbb.txt"));
int n;
byte[] buf = new byte[1024];
while((n = is.read(buf)) != -1) {
os.write(buf, 0, n);
}
}
} |
|