private File book_file = null;
private MappedByteBuffer m_mbBuf = null;
private int m_mbBufLen = 0;
public void openbook(String strFilePath) throws Exception {
book_file = new File(strFilePath);
long lLen = book_file.length();
m_mbBufLen = (int) lLen;
m_mbBuf = new RandomAccessFile(book_file, "r").getChannel().map(
FileChannel.MapMode.READ_ONLY, 0, lLen);
}
------解决方案--------------------------------------------------------
问题是什么?
位置记录
getFilePointer()