public abstract class IndexInput extends DataInput implements Cloneable, Closeable
Directory. A
random-access input stream. Used for all Lucene index input operations.Directory| Modifier | Constructor and Description |
|---|---|
protected |
IndexInput(String resourceDescription)
resourceDescription should be a non-null, opaque string
describing this resource; it's returned from
toString(). |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes the stream to further operations.
|
void |
copyBytes(IndexOutput out,
long numBytes)
Copies
numBytes bytes to the given IndexOutput. |
abstract long |
getFilePointer()
Returns the current position in this file, where the next read will
occur.
|
abstract long |
length()
The number of bytes in the file.
|
abstract void |
seek(long pos)
Sets current position in this file, where the next read will occur.
|
String |
toString() |
clone, readByte, readBytes, readBytes, readInt, readLong, readShort, readString, readStringSet, readStringStringMap, readVInt, readVLongprotected IndexInput(String resourceDescription)
toString().public abstract void close()
throws IOException
close in interface CloseableIOExceptionpublic abstract long getFilePointer()
seek(long)public abstract void seek(long pos)
throws IOException
IOExceptiongetFilePointer()public abstract long length()
public void copyBytes(IndexOutput out, long numBytes) throws IOException
numBytes 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.
IOExceptionCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.