随机文件读写

RandomAccessFile randomAccessFile = new RandomAccessFile("E:/test1.html", "r");
            RandomAccessFile w = new RandomAccessFile("E:/test12.html", "rw");
            byte[] b = new byte[2];
            int i = 0;
            for (; (i = randomAccessFile.read(b)) != -1; ) {
                w.write(b);
            }
            randomAccessFile.close();
            w.close();

 

posted @ 2020-01-10 21:10  soft.push("zzq")  Views(129)  Comments(0Edit  收藏  举报