本帖最后由 zl78365336 于 2013-12-6 20:27 编辑
复制文件与复制文件夹有哪些具体的区别?
- InputStream is = new FileInputStream(new File("用来读的文件的路径"));
- OutputStream os = new FileOutputStream(new File("写入的文件的路径"));
- byte[] buff=new byte[8192];
- int length = 0;
- while((length=is.read(buff))!=-1){
- os.write(buff,0,length);
- }
- 关流
复制代码 |