Home » lucene-3.0.1-src » org.apache » lucene » store » [javadoc | source]
org.apache.lucene.store
abstract public class: IndexInput [javadoc | source]
java.lang.Object
   org.apache.lucene.store.IndexInput

All Implemented Interfaces:
    Cloneable, Closeable

Direct Known Subclasses:
    RAMInputStream, SimpleFSIndexInput, CSIndexInput, MMapIndexInput, ChecksumIndexInput, ByteSliceReader, BufferedIndexInput, GCJIndexInput, DbIndexInput, MultiMMapIndexInput, NIOFSIndexInput, SkipBuffer, JEIndexInput

Abstract base class for input from a file in a Directory . A random-access input stream. Used for all Lucene index input operations.
Method from org.apache.lucene.store.IndexInput Summary:
clone,   close,   getFilePointer,   length,   readByte,   readBytes,   readBytes,   readChars,   readInt,   readLong,   readString,   readStringStringMap,   readVInt,   readVLong,   seek,   setModifiedUTF8StringsMode,   skipChars
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.store.IndexInput Detail:
 public Object clone() 
    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.

 abstract public  void close() throws IOException
    Closes the stream to further 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() throws IOException
    Reads and returns a single byte.
 abstract public  void readBytes(byte[] b,
    int offset,
    int len) throws IOException
    Reads a specified number of bytes into an array at the specified offset.
 public  void readBytes(byte[] b,
    int offset,
    int len,
    boolean useBuffer) throws IOException 
    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.
 public  void readChars(char[] buffer,
    int start,
    int length) throws IOException 
Deprecated! -- - please use readString or readBytes instead, and construct the string from those utf8 bytes

    Reads Lucene's old "modified UTF-8" encoded characters into an array.
 public int readInt() throws IOException 
    Reads four bytes and returns an int.
 public long readLong() throws IOException 
    Reads eight bytes and returns a long.
 public String readString() throws IOException 
    Reads a string.
 public Map<String, String> readStringStringMap() throws IOException 
 public int readVInt() throws IOException 
    Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
 public long readVLong() throws IOException 
    Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.
 abstract public  void seek(long pos) throws IOException
    Sets current position in this file, where the next read will occur.
 public  void setModifiedUTF8StringsMode() 
    Call this if readString should read characters stored in the old modified UTF8 format (length in java chars and java's modified UTF8 encoding). This is used for indices written pre-2.4 See LUCENE-510 for details.
 public  void skipChars(int length) throws IOException 
Deprecated! this - method operates on old "modified utf8" encoded strings

    Expert Similar to #readChars(char[], int, int) but does not do any conversion operations on the bytes it is reading in. It still has to invoke #readByte() just as #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 read