org.apache.lucene.store
Class ConfigurableBufferedIndexInput
java.lang.Object
org.apache.lucene.store.IndexInput
org.apache.lucene.store.ConfigurableBufferedIndexInput
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- FSTransLog.TransDirectory.TransIndexInput, JdbcBufferedIndexInput
public abstract class ConfigurableBufferedIndexInput
- extends IndexInput
A simple base class that performs index input memory based buffering. Allows the buffer size to be
configurable.
- Author:
- kimchy
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE
- The default value for the buffer size (in bytes). Currently 1024.
- See Also:
- Constant Field Values
buffer
protected byte[] buffer
bufferStart
protected long bufferStart
bufferLength
protected int bufferLength
bufferPosition
protected int bufferPosition
bufferSize
protected int bufferSize
ConfigurableBufferedIndexInput
public ConfigurableBufferedIndexInput()
initBuffer
protected void initBuffer(int bufferSize)
readByte
public byte readByte()
throws IOException
- Specified by:
readByte in class IndexInput
- Throws:
IOException
readBytes
public void readBytes(byte[] b,
int offset,
int len)
throws IOException
- Specified by:
readBytes in class IndexInput
- Throws:
IOException
refill
protected void refill()
throws IOException
- Throws:
IOException
readInternal
protected abstract void readInternal(byte[] b,
int offset,
int length)
throws IOException
- Expert: implements buffer refill. Reads bytes from the current position
in the input.
- Parameters:
b - the array to read bytes intooffset - the offset in the array to start storing byteslength - the number of bytes to read
- Throws:
IOException
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointer in class IndexInput
seek
public void seek(long pos)
throws IOException
- Specified by:
seek in class IndexInput
- Throws:
IOException
seekInternal
protected abstract void seekInternal(long pos)
throws IOException
- Expert: implements seek. Sets current position in this file, where the
next
readInternal(byte[],int,int) will occur.
- Throws:
IOException- See Also:
readInternal(byte[],int,int)
clone
public Object clone()
- Overrides:
clone in class IndexInput
Copyright (c) 2004-2006 The Compass Project.