public abstract class IndexInput extends DataInput implements java.lang.Cloneable, java.io.Closeable
Directory. A
random-access input stream. Used for all Lucene index input operations.Directory| Modifier | Constructor and Description |
|---|---|
protected |
IndexInput()
Deprecated.
please pass resourceDescription
|
protected |
IndexInput(java.lang.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.
|
void |
skipChars(int length)
Deprecated.
this method operates on old "modified utf8" encoded
strings
|
java.lang.String |
toString() |
clone, readByte, readBytes, readBytes, readChars, readInt, readLong, readShort, readString, readStringStringMap, readVInt, readVLong, setModifiedUTF8StringsMode@Deprecated protected IndexInput()
protected IndexInput(java.lang.String resourceDescription)
toString().@Deprecated
public void skipChars(int length)
throws java.io.IOException
DataInput.readChars(char[], int, int) but does not do any conversion operations on the bytes it is reading in. It still
has to invoke DataInput.readByte() just as DataInput.readChars(char[], int, int) does, but it does not need a buffer to store anything
and it does not have to do any of the bitwise operations, since we don't actually care what is in the byte except to determine
how many more bytes to readlength - The number of chars to readjava.io.IOExceptionpublic abstract void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic abstract long getFilePointer()
seek(long)public abstract void seek(long pos)
throws java.io.IOException
java.io.IOExceptiongetFilePointer()public abstract long length()
public void copyBytes(IndexOutput out, long numBytes) throws java.io.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.
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object