|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.store.IndexInput
org.apache.lucene.store.BufferedIndexInput
public abstract class BufferedIndexInput
Base implementation class for buffered IndexInput.
| Field Summary | |
|---|---|
protected byte[] |
buffer
|
static int |
BUFFER_SIZE
Default buffer size |
| Constructor Summary | |
|---|---|
BufferedIndexInput()
|
|
BufferedIndexInput(int bufferSize)
Inits BufferedIndexInput with a specific bufferSize |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a clone of this stream. |
int |
getBufferSize()
Returns buffer size. |
long |
getFilePointer()
Returns the current position in this file, where the next read will occur. |
protected void |
newBuffer(byte[] newBuffer)
|
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 |
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). |
protected abstract void |
readInternal(byte[] b,
int offset,
int length)
Expert: implements buffer refill. |
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. |
void |
setBufferSize(int newSize)
Change the buffer size used by this IndexInput |
| Methods inherited from class org.apache.lucene.store.IndexInput |
|---|
close, length, readChars, readInt, readLong, readString, readStringStringMap, readVInt, readVLong, setModifiedUTF8StringsMode, skipChars |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BUFFER_SIZE
protected byte[] buffer
| Constructor Detail |
|---|
public BufferedIndexInput()
public BufferedIndexInput(int bufferSize)
| Method Detail |
|---|
public byte readByte()
throws IOException
IndexInput
readByte in class IndexInputIOExceptionIndexOutput.writeByte(byte)public void setBufferSize(int newSize)
protected void newBuffer(byte[] newBuffer)
public int getBufferSize()
public void readBytes(byte[] b,
int offset,
int len)
throws IOException
IndexInput
readBytes in class IndexInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to read
IOExceptionIndexOutput.writeBytes(byte[],int)
public void readBytes(byte[] b,
int offset,
int len,
boolean useBuffer)
throws IOException
IndexInputBufferedIndexInput respects this parameter.
readBytes in class IndexInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readuseBuffer - set to false if the caller will handle
buffering.
IOExceptionIndexOutput.writeBytes(byte[],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
IOExceptionpublic long getFilePointer()
IndexInput
getFilePointer in class IndexInputIndexInput.seek(long)
public void seek(long pos)
throws IOException
IndexInput
seek in class IndexInputIOExceptionIndexInput.getFilePointer()
protected abstract void seekInternal(long pos)
throws IOException
readInternal(byte[],int,int) will occur.
IOExceptionreadInternal(byte[],int,int)public Object clone()
IndexInputClones 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 IndexInput
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||