如下一段代码,本人做个阅读器,要求记录阅读的位置,求高人帮忙!个人QQ454564889
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()