|
||||||||||
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.ConfigurableBufferedIndexInput
public abstract class ConfigurableBufferedIndexInput
A simple base class that performs index input memory based buffering. Allows the buffer size to be configurable.
Field Summary | |
---|---|
protected byte[] |
buffer
|
static int |
BUFFER_SIZE
Default buffer size |
protected int |
bufferLength
|
protected int |
bufferPosition
|
protected int |
bufferSize
|
protected long |
bufferStart
|
Constructor Summary | |
---|---|
ConfigurableBufferedIndexInput()
|
|
ConfigurableBufferedIndexInput(int bufferSize)
Inits BufferedIndexInput with a specific bufferSize |
Method Summary | |
---|---|
Object |
clone()
|
int |
getBufferSize()
Returns buffer size. |
long |
getFilePointer()
|
byte |
readByte()
|
void |
readBytes(byte[] b,
int offset,
int len)
|
protected abstract void |
readInternal(byte[] b,
int offset,
int length)
Expert: implements buffer refill. |
protected void |
refill()
|
void |
seek(long pos)
|
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, readBytes, readChars, readInt, readLong, readString, 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 int bufferSize
protected byte[] buffer
protected long bufferStart
protected int bufferLength
protected int bufferPosition
Constructor Detail |
---|
public ConfigurableBufferedIndexInput()
public ConfigurableBufferedIndexInput(int bufferSize)
Method Detail |
---|
public byte readByte() throws IOException
readByte
in class IndexInput
IOException
public void setBufferSize(int newSize)
public int getBufferSize()
public void readBytes(byte[] b, int offset, int len) throws IOException
readBytes
in class IndexInput
IOException
protected void refill() throws IOException
IOException
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 long getFilePointer()
getFilePointer
in class IndexInput
public void seek(long pos) throws IOException
seek
in class IndexInput
IOException
protected abstract void seekInternal(long pos) throws IOException
readInternal(byte[],int,int)
will occur.
IOException
readInternal(byte[],int,int)
public Object clone()
clone
in class IndexInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |