| java.lang.Object org.apache.lucene.store.IndexInput
All known Subclasses: org.apache.lucene.store.BufferedIndexInput, org.apache.lucene.store.db.DbIndexInput, org.apache.lucene.store.GCJIndexInput, org.apache.lucene.store.je.JEIndexInput, org.apache.lucene.store.RAMInputStream,
IndexInput | abstract public class IndexInput implements Cloneable(Code) | | Abstract base class for input from a file in a
Directory . A
random-access input stream. Used for all Lucene index input operations.
See Also: Directory |
Method Summary | |
public Object | clone() Returns a clone of this stream. | abstract public void | close() Closes the stream to futher operations. | abstract public long | getFilePointer() Returns the current position in this file, where the next read will
occur. | abstract public long | length() The number of bytes in the file. | abstract public byte | readByte() Reads and returns a single byte. | abstract public void | readBytes(byte[] b, int offset, int len) Reads a specified number of bytes into an array at the specified offset. | public void | readBytes(byte[] b, int offset, int len, boolean useBuffer) Reads a specified number of bytes into an array at the
specified offset with control over whether the read
should be buffered (callers who have their own buffer
should pass in "false" for useBuffer). | public void | readChars(char[] buffer, int start, int length) Reads UTF-8 encoded characters into an array. | public int | readInt() Reads four bytes and returns an int. | public long | readLong() Reads eight bytes and returns a long. | public String | readString() Reads a string. | public int | readVInt() Reads an int stored in variable-length format. | public long | readVLong() Reads a long stored in variable-length format. | abstract public void | seek(long pos) Sets current position in this file, where the next read will occur. | public void | skipChars(int length) Expert
Similar to
IndexInput.readChars(char[],int,int) but does not do any conversion operations on the bytes it is reading in. |
clone | public Object clone()(Code) | | Returns a clone of this stream.
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.
|
close | abstract public void close() throws IOException(Code) | | Closes the stream to futher operations.
|
getFilePointer | abstract public long getFilePointer()(Code) | | Returns the current position in this file, where the next read will
occur.
See Also: IndexInput.seek(long) |
length | abstract public long length()(Code) | | The number of bytes in the file.
|
readBytes | abstract public void readBytes(byte[] b, int offset, int len) throws IOException(Code) | | Reads a specified number of bytes into an array at the specified offset.
Parameters: b - the array to read bytes into Parameters: offset - the offset in the array to start storing bytes Parameters: len - the number of bytes to read See Also: IndexOutput.writeBytes(byte[]int) |
readBytes | public void readBytes(byte[] b, int offset, int len, boolean useBuffer) throws IOException(Code) | | Reads a specified number of bytes into an array at the
specified offset with control over whether the read
should be buffered (callers who have their own buffer
should pass in "false" for useBuffer). Currently only
BufferedIndexInput respects this parameter.
Parameters: b - the array to read bytes into Parameters: offset - the offset in the array to start storing bytes Parameters: len - the number of bytes to read Parameters: useBuffer - set to false if the caller will handlebuffering. See Also: IndexOutput.writeBytes(byte[]int) |
readChars | public void readChars(char[] buffer, int start, int length) throws IOException(Code) | | Reads UTF-8 encoded characters into an array.
Parameters: buffer - the array to read characters into Parameters: start - the offset in the array to start storing characters Parameters: length - the number of characters to read See Also: IndexOutput.writeChars(Stringintint) |
readVInt | public int readVInt() throws IOException(Code) | | Reads an int stored in variable-length format. Reads between one and
five bytes. Smaller values take fewer bytes. Negative numbers are not
supported.
See Also: IndexOutput.writeVInt(int) |
readVLong | public long readVLong() throws IOException(Code) | | Reads a long stored in variable-length format. Reads between one and
nine bytes. Smaller values take fewer bytes. Negative numbers are not
supported.
|
|
|