protected static class NIOFSDirectory.NIOFSIndexInput extends BufferedIndexInput
FileChannel.read(ByteBuffer, long)| Modifier and Type | Field and Description |
|---|---|
protected FileChannel |
channel
the file channel we will read from
|
protected long |
end
end offset (start+length)
|
protected long |
off
start offset: non-zero in the slice case
|
buffer, BUFFER_SIZE, MERGE_BUFFER_SIZE| Constructor and Description |
|---|
NIOFSDirectory.NIOFSIndexInput(String resourceDesc,
FileChannel fc,
IOContext context) |
NIOFSDirectory.NIOFSIndexInput(String resourceDesc,
FileChannel fc,
long off,
long length,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
NIOFSDirectory.NIOFSIndexInput |
clone()
Returns a clone of this stream.
|
void |
close()
Closes the stream to further operations.
|
long |
length()
The number of bytes in the file.
|
protected void |
newBuffer(byte[] newBuffer) |
protected void |
readInternal(byte[] b,
int offset,
int len)
Expert: implements buffer refill.
|
protected void |
seekInternal(long pos)
Expert: implements seek.
|
bufferSize, flushBuffer, getBufferSize, getFilePointer, readByte, readBytes, readBytes, readInt, readLong, readShort, readVInt, readVLong, seek, setBufferSizetoStringreadString, readStringSet, readStringStringMap, skipBytesprotected final FileChannel channel
protected final long off
protected final long end
public NIOFSDirectory.NIOFSIndexInput(String resourceDesc, FileChannel fc, IOContext context) throws IOException
IOExceptionpublic NIOFSDirectory.NIOFSIndexInput(String resourceDesc, FileChannel fc, long off, long length, int bufferSize)
public void close()
throws IOException
IndexInputclose in interface Closeableclose in interface AutoCloseableclose in class IndexInputIOExceptionpublic NIOFSDirectory.NIOFSIndexInput clone()
IndexInputClones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.
Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.
Warning: Lucene never closes cloned
IndexInputs, it will only do this on the original one.
The original instance must take care that cloned instances throw
AlreadyClosedException when the original one is closed.
clone in class BufferedIndexInputpublic final long length()
IndexInputlength in class IndexInputprotected void newBuffer(byte[] newBuffer)
newBuffer in class BufferedIndexInputprotected void readInternal(byte[] b,
int offset,
int len)
throws IOException
BufferedIndexInputreadInternal in class BufferedIndexInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readIOExceptionprotected void seekInternal(long pos)
throws IOException
BufferedIndexInputBufferedIndexInput.readInternal(byte[],int,int) will occur.seekInternal in class BufferedIndexInputIOExceptionBufferedIndexInput.readInternal(byte[],int,int)Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.