字节流拷备文档 学会了可以拷一切 1216

import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;public class Test2 { public static void main(String[] args) throws IOException { // 获取字节输入流 FileInputStream xsRead = new FileInputStream(“小说.txt”); // 获取字节数组 byte[] bytes = new byte[200]; // 获取字节输出流 FileOutputStream xsWrite = new FileOutputStream(“小说_字节_拷备.txt”); // 遍历读字节 int len = xsRead.read(bytes); while (len != -1) { // 代码来到这里 意味羞容器中有数据 // 立马写数据 xsWrite.write(bytes, 0, len); // 游戏移动 len = xsRead.read(bytes); } // 关资源 xsWrite.close(); xsRead.close(); // 程序结束 System.out.println(“game over”); }} 也许不是自己该去发挥的地方,还是让自己到最适合自己战斗的方面去吧!勇敢的接受自己的失败,

字节流拷备文档 学会了可以拷一切 1216

相关文章:

你感兴趣的文章:

标签云: