protected static class SimpleFSDirectory.SimpleFSIndexInput extends BufferedIndexInput
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SimpleFSDirectory.SimpleFSIndexInput.Descriptor |
| Modifier and Type | Field and Description |
|---|---|
protected int |
chunkSize |
protected long |
end |
protected SimpleFSDirectory.SimpleFSIndexInput.Descriptor |
file |
protected long |
off |
buffer, BUFFER_SIZE, MERGE_BUFFER_SIZE| Constructor and Description |
|---|
SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc,
File path,
IOContext context,
int chunkSize) |
SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc,
SimpleFSDirectory.SimpleFSIndexInput.Descriptor file,
long off,
long length,
int bufferSize,
int chunkSize) |
| Modifier and Type | Method and Description |
|---|---|
SimpleFSDirectory.SimpleFSIndexInput |
clone()
Returns a clone of this stream.
|
void |
close()
Closes the stream to further operations.
|
void |
copyBytes(IndexOutput out,
long numBytes)
Copies
numBytes bytes to the given IndexOutput. |
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, setBufferSizetoStringreadString, readStringSet, readStringStringMapprotected final SimpleFSDirectory.SimpleFSIndexInput.Descriptor file
protected final int chunkSize
protected final long off
protected final long end
public SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc, File path, IOContext context, int chunkSize) throws IOException
IOExceptionpublic SimpleFSDirectory.SimpleFSIndexInput(String resourceDesc, SimpleFSDirectory.SimpleFSIndexInput.Descriptor file, long off, long length, int bufferSize, int chunkSize)
protected void readInternal(byte[] b,
int offset,
int len)
throws IOException
readInternal in class BufferedIndexInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readIOExceptionpublic void close()
throws IOException
IndexInputclose in interface Closeableclose in class IndexInputIOExceptionprotected void seekInternal(long position)
BufferedIndexInputBufferedIndexInput.readInternal(byte[],int,int) will occur.seekInternal in class BufferedIndexInputBufferedIndexInput.readInternal(byte[],int,int)public long length()
IndexInputlength in class IndexInputpublic SimpleFSDirectory.SimpleFSIndexInput clone()
DataInputClones 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.
clone in class BufferedIndexInputpublic void copyBytes(IndexOutput out, long numBytes) throws IOException
IndexInputnumBytes bytes to the given IndexOutput.
NOTE: this method uses an intermediate buffer to copy the bytes. Consider overriding it in your implementation, if you can make a better, optimized copy.
NOTE ensure that there are enough bytes in the input to copy to output. Otherwise, different exceptions may be thrown, depending on the implementation.
copyBytes in class BufferedIndexInputIOExceptionCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.