@Override public void seek(long pos) throws IOException { if (pos != getFilePointer()) { final long alignedPos = pos & ALIGN_NOT_MASK; filePos = alignedPos-bufferSize; final int delta = (int) (pos - alignedPos); if (delta != 0) { refill(); buffer.position(delta); bufferPos = delta; } else { // force refill on next read bufferPos = bufferSize; } } }
@Override public void seek(long pos) throws IOException { if (pos != getFilePointer()) { final long alignedPos = pos & ALIGN_NOT_MASK; filePos = alignedPos-bufferSize; final int delta = (int) (pos - alignedPos); if (delta != 0) { refill(); buffer.position(delta); bufferPos = delta; } else { // force refill on next read bufferPos = bufferSize; } } }
@Override public void seek(long pos) throws IOException { if (pos != getFilePointer()) { final long alignedPos = pos & ALIGN_NOT_MASK; filePos = alignedPos-bufferSize; final int delta = (int) (pos - alignedPos); if (delta != 0) { refill(); buffer.position(delta); bufferPos = delta; } else { // force refill on next read bufferPos = bufferSize; } } }
public NativeUnixIndexInput(NativeUnixIndexInput other) throws IOException { super(other.toString()); this.fis = null; channel = other.channel; this.bufferSize = other.bufferSize; buffer = ByteBuffer.allocateDirect(bufferSize); filePos = -bufferSize; bufferPos = bufferSize; isOpen = true; isClone = true; //System.out.println("D clone this=" + this); seek(other.getFilePointer()); }
public NativeUnixIndexInput(NativeUnixIndexInput other) throws IOException { super(other.toString()); this.fis = null; channel = other.channel; this.bufferSize = other.bufferSize; buffer = ByteBuffer.allocateDirect(bufferSize); filePos = -bufferSize; bufferPos = bufferSize; isOpen = true; isClone = true; //System.out.println("D clone this=" + this); seek(other.getFilePointer()); }
public NativeUnixIndexInput(NativeUnixIndexInput other) throws IOException { super(other.toString()); this.fis = null; channel = other.channel; this.bufferSize = other.bufferSize; buffer = ByteBuffer.allocateDirect(bufferSize); filePos = -bufferSize; bufferPos = bufferSize; isOpen = true; isClone = true; //System.out.println("D clone this=" + this); seek(other.getFilePointer()); }