private static final class NativeUnixDirectory.NativeUnixIndexInput extends IndexInput
| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
buffer |
private int |
bufferPos |
private int |
bufferSize |
private java.nio.channels.FileChannel |
channel |
private long |
filePos |
private java.io.FileInputStream |
fis |
private boolean |
isClone |
private boolean |
isOpen |
| Constructor and Description |
|---|
NativeUnixIndexInput(NativeUnixDirectory.NativeUnixIndexInput other) |
NativeUnixIndexInput(java.nio.file.Path path,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
NativeUnixDirectory.NativeUnixIndexInput |
clone()
Returns a clone of this stream.
|
void |
close()
Closes the stream to further operations.
|
long |
getFilePointer()
Returns the current position in this file, where the next read will
occur.
|
long |
length()
The number of bytes in the file.
|
byte |
readByte()
Reads and returns a single byte.
|
void |
readBytes(byte[] dst,
int offset,
int len)
Reads a specified number of bytes into an array at the specified offset.
|
private void |
refill() |
void |
seek(long pos)
Sets current position in this file, where the next read will occur.
|
IndexInput |
slice(java.lang.String sliceDescription,
long offset,
long length)
Creates a slice of this index input, with the given description, offset, and length.
|
getFullSliceDescription, randomAccessSlice, toStringreadBytes, readInt, readLELongs, readLong, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong, skipBytesprivate final java.nio.ByteBuffer buffer
private final java.io.FileInputStream fis
private final java.nio.channels.FileChannel channel
private final int bufferSize
private boolean isOpen
private boolean isClone
private long filePos
private int bufferPos
public NativeUnixIndexInput(java.nio.file.Path path,
int bufferSize)
throws java.io.IOException
java.io.IOExceptionpublic NativeUnixIndexInput(NativeUnixDirectory.NativeUnixIndexInput other) throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
IndexInputclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class IndexInputjava.io.IOExceptionpublic long getFilePointer()
IndexInputgetFilePointer in class IndexInputIndexInput.seek(long)public void seek(long pos)
throws java.io.IOException
IndexInputEOFException and then the
stream is in an undetermined state.seek in class IndexInputjava.io.IOExceptionIndexInput.getFilePointer()public long length()
IndexInputlength in class IndexInputpublic byte readByte()
throws java.io.IOException
DataInputreadByte in class DataInputjava.io.IOExceptionDataOutput.writeByte(byte)private void refill()
throws java.io.IOException
java.io.IOExceptionpublic void readBytes(byte[] dst,
int offset,
int len)
throws java.io.IOException
DataInputreadBytes in class DataInputdst - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readjava.io.IOExceptionDataOutput.writeBytes(byte[],int)public NativeUnixDirectory.NativeUnixIndexInput 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 call IndexInput.close() on the original object.
If you access the cloned IndexInput after closing the original object,
any readXXX methods will throw AlreadyClosedException.
This method is NOT thread safe, so if the current IndexInput
is being used by one thread while clone is called by another,
disaster could strike.
clone in class IndexInputpublic IndexInput slice(java.lang.String sliceDescription, long offset, long length) throws java.io.IOException
IndexInputslice in class IndexInputjava.io.IOException