remove otherBuffer/otherByteBuf tracking: this is pointless now that compound files are handled as slices

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1232084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-01-16 18:05:28 +00:00
parent 5ff6f19980
commit dee0f7bd55
1 changed files with 1 additions and 19 deletions

View File

@ -110,9 +110,6 @@ public class NIOFSDirectory extends FSDirectory {
private ByteBuffer byteBuf; // wraps the buffer for NIO
private byte[] otherBuffer;
private ByteBuffer otherByteBuf;
final FileChannel channel;
public NIOFSIndexInput(File path, IOContext context, int chunkSize) throws IOException {
@ -157,22 +154,7 @@ public class NIOFSDirectory extends FSDirectory {
byteBuf.limit(len);
bb = byteBuf;
} else {
if (offset == 0) {
if (otherBuffer != b) {
// Now wrap this other buffer; with compound
// file, we are repeatedly called with its
// buffer, so we wrap it once and then re-use it
// on subsequent calls
otherBuffer = b;
otherByteBuf = ByteBuffer.wrap(b);
} else
otherByteBuf.clear();
otherByteBuf.limit(len);
bb = otherByteBuf;
} else {
// Always wrap when offset != 0
bb = ByteBuffer.wrap(b, offset, len);
}
bb = ByteBuffer.wrap(b, offset, len);
}
int readOffset = bb.position();