/////////////////////////////////////////////////////////
Charset charset = Charset.forName("ISO-8859-15");
    CharsetDecoder decoder = charset.newDecoder(); //  获得共享内存缓冲区,该共享内存只读
long size = new File("README.txt").length();
System.out.println("文件内容为:" + size);
FileInputStream fin = null;
try {
fin = new FileInputStream( "README.txt" );
} catch (FileNotFoundException e1) {
// TODO 自动生成 catch 块
e1.printStackTrace();
}
// 获得相应的文件通道
FileChannel fc = fin.getChannel();
MappedByteBuffer mapBuf = null;
try {
mapBuf = fc.map(FileChannel.MapMode.READ_ONLY, 0,size);
} catch (IOException e2) {
// TODO 自动生成 catch 块
e2.printStackTrace();
}
byte[] testBuf = new byte[102400];
ByteBuffer byteBuffer = ByteBuffer.wrap(testBuf);
long sum = 0;
for (int i=0; i<size; ++i)
{
// sum = mapBuf.get(i);
// char str;
// str = mapBuf.getChar(i);
// System.out.println( "str: "+str );
}
try {
fin.close();
} catch (IOException e3) {
// TODO 自动生成 catch 块
e3.printStackTrace();
}
   ///////////////////////////////////////////////////////这样可以吗?我为什么看不到内存的变化呢