public abstract class IndexInput extends Object implements Cloneable
Directory. A
random-access input stream. Used for all Lucene index input operations.Directory| Constructor and Description |
|---|
IndexInput() |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Returns a clone of this stream.
|
abstract void |
close()
Closes the stream to futher 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 byte |
readByte()
Reads and returns a single byte.
|
abstract void |
readBytes(byte[] b,
int offset,
int len)
Reads a specified number of bytes into an array at the specified offset.
|
void |
readChars(char[] buffer,
int start,
int length)
Reads UTF-8 encoded characters into an array.
|
int |
readInt()
Reads four bytes and returns an int.
|
long |
readLong()
Reads eight bytes and returns a long.
|
String |
readString()
Reads a string.
|
int |
readVInt()
Reads an int stored in variable-length format.
|
long |
readVLong()
Reads a long stored in variable-length format.
|
abstract void |
seek(long pos)
Sets current position in this file, where the next read will occur.
|
public abstract byte readByte()
throws IOException
IOExceptionIndexOutput.writeByte(byte)public abstract void readBytes(byte[] b,
int offset,
int len)
throws IOException
b - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readIOExceptionIndexOutput.writeBytes(byte[],int)public int readInt()
throws IOException
IOExceptionIndexOutput.writeInt(int)public int readVInt()
throws IOException
IOExceptionIndexOutput.writeVInt(int)public long readLong()
throws IOException
IOExceptionIndexOutput.writeLong(long)public long readVLong()
throws IOException
IOExceptionpublic String readString() throws IOException
IOExceptionIndexOutput.writeString(String)public void readChars(char[] buffer,
int start,
int length)
throws IOException
buffer - the array to read characters intostart - the offset in the array to start storing characterslength - the number of characters to readIOExceptionIndexOutput.writeChars(String,int,int)public abstract void close()
throws IOException
IOExceptionpublic abstract long getFilePointer()
seek(long)public abstract void seek(long pos)
throws IOException
IOExceptiongetFilePointer()public abstract long length()
public Object 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.
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.