提交 b22ed608 authored 作者: Thomas Mueller's avatar Thomas Mueller

Off-heap storage

上级 76f8ac82
......@@ -38,14 +38,11 @@ public class OffHeapStore extends FileStore {
}
readCount++;
ByteBuffer buff = memEntry.getValue();
int oldLimit = buff.limit();
ByteBuffer read = buff.duplicate();
int offset = (int) (pos - memEntry.getKey());
buff.position(offset);
buff.limit(len + offset);
ByteBuffer read = buff.slice();
buff.position(0);
buff.limit(oldLimit);
return read;
read.position(offset);
read.limit(len + offset);
return read.slice();
}
@Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论