随机文件读写

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();

猜你喜欢

转载自www.cnblogs.com/zzq-include/p/12178150.html