|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.store.DataInput org.apache.lucene.store.IndexInput
public abstract class IndexInput
Abstract base class for input from a file in a Directory
. A
random-access input stream. Used for all Lucene index input operations.
IndexInput
may only be used from one thread, because it is not
thread safe (it keeps internal state like file position). To allow
multithreaded use, every IndexInput
instance must be cloned before
used in another thread. Subclasses must therefore implement clone()
,
returning a new IndexInput
which operates on the same underlying
resource, but positioned independently. 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.
Directory
Constructor Summary | |
---|---|
protected |
IndexInput(String resourceDescription)
resourceDescription should be a non-null, opaque string describing this resource; it's returned from toString() . |
Method Summary | |
---|---|
IndexInput |
clone()
Returns a clone of this stream. |
abstract void |
close()
Closes the stream to further operations. |
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()
|
Methods inherited from class org.apache.lucene.store.DataInput |
---|
readByte, readBytes, readBytes, readInt, readLong, readShort, readString, readStringSet, readStringStringMap, readVInt, readVLong |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected IndexInput(String resourceDescription)
toString()
.
Method Detail |
---|
public abstract void close() throws IOException
close
in interface Closeable
IOException
public abstract long getFilePointer()
seek(long)
public abstract void seek(long pos) throws IOException
IOException
getFilePointer()
public abstract long length()
public String toString()
toString
in class Object
public IndexInput clone()
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 DataInput
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |