org.apache.lucene.store
Class BufferedIndexInput
- java.lang.Object
-
- org.apache.lucene.store.IndexInput
-
- org.apache.lucene.store.BufferedIndexInput
-
- All Implemented Interfaces:
- java.lang.Cloneable
public abstract class BufferedIndexInput extends IndexInput
Base implementation class for bufferedIndexInput.
-
-
Field Summary
Fields Modifier and Type Field and Description static intBUFFER_SIZEDefault buffer size
-
Constructor Summary
Constructors Constructor and Description BufferedIndexInput()BufferedIndexInput(int bufferSize)Inits BufferedIndexInput with a specific bufferSize
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()Returns a clone of this stream.intgetBufferSize()Returns buffer size.longgetFilePointer()Returns the current position in this file, where the next read will occur.bytereadByte()Reads and returns a single byte.voidreadBytes(byte[] b, int offset, int len)Reads a specified number of bytes into an array at the specified offset.voidreadBytes(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).voidseek(long pos)Sets current position in this file, where the next read will occur.voidsetBufferSize(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, readVInt, readVLong, skipChars
-
-
-
-
Field Detail
-
BUFFER_SIZE
public static final int BUFFER_SIZE
Default buffer size- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BufferedIndexInput
public BufferedIndexInput()
-
BufferedIndexInput
public BufferedIndexInput(int bufferSize)
Inits BufferedIndexInput with a specific bufferSize
-
-
Method Detail
-
readByte
public byte readByte() throws java.io.IOExceptionDescription copied from class:IndexInputReads and returns a single byte.- Specified by:
readBytein classIndexInput- Throws:
java.io.IOException- See Also:
IndexOutput.writeByte(byte)
-
setBufferSize
public void setBufferSize(int newSize)
Change the buffer size used by this IndexInput
-
getBufferSize
public int getBufferSize()
Returns buffer size. @see #setBufferSize
-
readBytes
public void readBytes(byte[] b, int offset, int len) throws java.io.IOExceptionDescription copied from class:IndexInputReads a specified number of bytes into an array at the specified offset.- Specified by:
readBytesin classIndexInput- Parameters:
b- the array to read bytes intooffset- the offset in the array to start storing byteslen- the number of bytes to read- Throws:
java.io.IOException- See Also:
IndexOutput.writeBytes(byte[],int)
-
readBytes
public void readBytes(byte[] b, int offset, int len, boolean useBuffer) throws java.io.IOExceptionDescription copied from class:IndexInputReads 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). Currently onlyBufferedIndexInputrespects this parameter.- Overrides:
readBytesin classIndexInput- Parameters:
b- 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.- Throws:
java.io.IOException- See Also:
IndexOutput.writeBytes(byte[],int)
-
getFilePointer
public long getFilePointer()
Description copied from class:IndexInputReturns the current position in this file, where the next read will occur.- Specified by:
getFilePointerin classIndexInput- See Also:
IndexInput.seek(long)
-
seek
public void seek(long pos) throws java.io.IOExceptionDescription copied from class:IndexInputSets current position in this file, where the next read will occur.- Specified by:
seekin classIndexInput- Throws:
java.io.IOException- See Also:
IndexInput.getFilePointer()
-
clone
public java.lang.Object clone()
Description copied from class:IndexInputReturns a clone of this stream.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.
- Overrides:
clonein classIndexInput
-
-
DataMelt 3.0 © DataMelt by jWork.ORG