怎么换算的啊?进制数之间可以转换,为什么两个不同计量单位之间也可以转换啊?代码如下:import java.nio.*;import java.nio.channels.*;import java.io.*;import static net.mindview.util.Print.*;public class LargeMappedFiles { static int length = 0x8FFFFFF; // 128 MB public static void main(String[] args) throws Exception { MappedByteBuffer out = new RandomAccessFile("test.dat", "rw").getChannel() .map(FileChannel.MapMode.READ_WRITE, 0, length); for(int i = 0; i < length; i++) out.put((byte)'x'); print("Finished writing"); for(int i = length/2; i < length/2 + 6; i++) printnb((char)out.get(i)); }}
添加回答
举报
0/150
提交
取消