protected static class SimpleFSDirectory.SimpleFSIndexInput extends BufferedIndexInput
RandomAccessFile.seek(long)
followed by
RandomAccessFile.read(byte[], int, int)
.Modifier and Type | Field and Description |
---|---|
protected long |
end
end offset (start+length)
|
protected RandomAccessFile |
file
the file channel we will read from
|
protected long |
off
start offset: non-zero in the slice case
|
buffer, BUFFER_SIZE, MERGE_BUFFER_SIZE
Constructor and Description |
---|
SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc,
RandomAccessFile file,
IOContext context) |
SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc,
RandomAccessFile file,
long off,
long length,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
SimpleFSDirectory.SimpleFSIndexInput |
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 |
readInternal(byte[] b,
int offset,
int len)
IndexInput methods
|
protected void |
seekInternal(long position)
Expert: implements seek.
|
bufferSize, flushBuffer, getBufferSize, getFilePointer, newBuffer, readByte, readBytes, readBytes, readInt, readLong, readShort, readVInt, readVLong, seek, setBufferSize
toString
readString, readStringSet, readStringStringMap, skipBytes
protected final RandomAccessFile file
protected final long off
protected final long end
public SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc, RandomAccessFile file, IOContext context) throws IOException
IOException
public SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc, RandomAccessFile file, long off, long length, int bufferSize)
public void close() throws IOException
IndexInput
close
in interface Closeable
close
in interface AutoCloseable
close
in class IndexInput
IOException
public SimpleFSDirectory.SimpleFSIndexInput clone()
IndexInput
Clones 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
IndexInput
s, 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 BufferedIndexInput
public final long length()
IndexInput
length
in class IndexInput
protected void readInternal(byte[] b, int offset, int len) throws IOException
readInternal
in class BufferedIndexInput
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to readIOException
protected void seekInternal(long position)
BufferedIndexInput
BufferedIndexInput.readInternal(byte[],int,int)
will occur.seekInternal
in class BufferedIndexInput
BufferedIndexInput.readInternal(byte[],int,int)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.