例子
字节处理流拷贝文件
import java.io.*;public class Main {public static void main(String[] args) throws Exception {String srcPath = "./story.txt";String copyPath = "./story_copy1.txt";BufferedInputStream bis = new BufferedInputStream(new FileInputStream(srcPath));BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(copyPath));byte[] buffer = new byte[2048];int readLen = 0;while ((readLen = bis.read(buffer)) != -1) {bos.write(buffer, 0, readLen);}bis.close();bos.close();}}
