创建一个读写存储器映射文件
import java.io.File;/*nowjava.com - 时代Java*/ import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; public class Main { public void main(String[] argv) { try { File file = new File("filename"); // Create a read-write memory-mapped file FileChannel rwChannel = new RandomAccessFile(file, "rw").getChannel();//来 自 时代Java公众号 - nowjava.com ByteBuffer wrBuf = rwChannel.map(