Java Nio中的三种内存映射缓冲区---MappedByteBuffer
开始有点跟不上实际思路了, 今天暂停吧。 作个记录。 package com.ronsoft.books.nio.channels; import java.io.File; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; public class MapFile { public static void main(String[] args) throws Exception { // TODO Auto-generated method stub File tempFile = File.createTempFile("mmaptest", null); RandomAccessFile file = new RandomAccessFile(tempFile, "rw"); FileChannel channel = file.getChannel(); ByteB...
