|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.creole.annic.apache.lucene.store.InputStream
public abstract class 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 | |
---|---|
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. |
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 IOException
IOException
OutputStream.writeByte(byte)
public final 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 read
IOException
OutputStream.writeBytes(byte[],int)
public final int readInt() throws IOException
IOException
OutputStream.writeInt(int)
public final int readVInt() throws IOException
IOException
OutputStream.writeVInt(int)
public final long readLong() throws IOException
IOException
OutputStream.writeLong(long)
public final long readVLong() throws IOException
IOException
public final String readString() throws IOException
IOException
OutputStream.writeString(String)
public final 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 read
IOException
OutputStream.writeChars(String,int,int)
protected abstract void readInternal(byte[] b, int offset, int length) throws IOException
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslength
- the number of bytes to read
IOException
public abstract void close() throws IOException
IOException
public final long getFilePointer()
seek(long)
public final void seek(long pos) throws IOException
IOException
getFilePointer()
protected abstract void seekInternal(long pos) throws IOException
readInternal(byte[],int,int)
will occur.
IOException
readInternal(byte[],int,int)
public final 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.
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |