|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.store.InputStream
Abstract base class for input from a file in a Directory
. A
random-access input stream. Used for all Lucene index input operations.
Directory
,
OutputStream
Field Summary | |
protected long |
length
|
Constructor Summary | |
InputStream()
|
Method Summary | |
java.lang.Object |
clone()
Returns a clone of this stream. |
abstract void |
close()
Closes the stream to futher operations. |
long |
getFilePointer()
Returns the current position in this file, where the next read will occur. |
long |
length()
The number of bytes in the file. |
byte |
readByte()
Reads and returns a single byte. |
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. |
protected abstract void |
readInternal(byte[] b,
int offset,
int length)
Expert: implements buffer refill. |
long |
readLong()
Reads eight bytes and returns a long. |
java.lang.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. |
void |
seek(long pos)
Sets current position in this file, where the next read will occur. |
protected abstract void |
seekInternal(long pos)
Expert: implements seek. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected long length
Constructor Detail |
public InputStream()
Method Detail |
public final byte readByte() throws java.io.IOException
java.io.IOException
OutputStream.writeByte(byte)
public final void readBytes(byte[] b, int offset, int len) throws java.io.IOException
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to read
java.io.IOException
OutputStream.writeBytes(byte[],int)
public final int readInt() throws java.io.IOException
java.io.IOException
OutputStream.writeInt(int)
public final int readVInt() throws java.io.IOException
java.io.IOException
OutputStream.writeVInt(int)
public final long readLong() throws java.io.IOException
java.io.IOException
OutputStream.writeLong(long)
public final long readVLong() throws java.io.IOException
java.io.IOException
public final java.lang.String readString() throws java.io.IOException
java.io.IOException
OutputStream.writeString(String)
public final void readChars(char[] buffer, int start, int length) throws java.io.IOException
buffer
- the array to read characters intostart
- the offset in the array to start storing characterslength
- the number of characters to read
java.io.IOException
OutputStream.writeChars(String,int,int)
protected abstract void readInternal(byte[] b, int offset, int length) throws java.io.IOException
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslength
- the number of bytes to read
java.io.IOException
public abstract void close() throws java.io.IOException
java.io.IOException
public final long getFilePointer()
seek(long)
public final void seek(long pos) throws java.io.IOException
java.io.IOException
getFilePointer()
protected abstract void seekInternal(long pos) throws java.io.IOException
readInternal(byte[],int,int)
will occur.
java.io.IOException
readInternal(byte[],int,int)
public final long length()
public java.lang.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.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |