public abstract class BufferedIndexInput extends IndexInput
IndexInput.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buffer |
static int |
BUFFER_SIZE
Default buffer size
|
| Constructor and Description |
|---|
BufferedIndexInput() |
BufferedIndexInput(int bufferSize)
Inits BufferedIndexInput with a specific bufferSize
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.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
|
close, length, readChars, readInt, readLong, readString, readStringStringMap, readVInt, readVLong, setModifiedUTF8StringsMode, skipCharspublic static final int BUFFER_SIZE
protected byte[] buffer
public BufferedIndexInput()
public BufferedIndexInput(int bufferSize)
public byte readByte()
throws java.io.IOException
IndexInputreadByte in class IndexInputjava.io.IOExceptionIndexOutput.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 java.io.IOException
IndexInputreadBytes in class IndexInputb - the array to read bytes intooffset - the offset in the array to start storing byteslen - the number of bytes to readjava.io.IOExceptionIndexOutput.writeBytes(byte[],int)public void readBytes(byte[] b,
int offset,
int len,
boolean useBuffer)
throws java.io.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.java.io.IOExceptionIndexOutput.writeBytes(byte[],int)protected abstract void readInternal(byte[] b,
int offset,
int length)
throws java.io.IOException
b - the array to read bytes intooffset - the offset in the array to start storing byteslength - the number of bytes to readjava.io.IOExceptionpublic long getFilePointer()
IndexInputgetFilePointer in class IndexInputIndexInput.seek(long)public void seek(long pos)
throws java.io.IOException
IndexInputseek in class IndexInputjava.io.IOExceptionIndexInput.getFilePointer()protected abstract void seekInternal(long pos)
throws java.io.IOException
readInternal(byte[],int,int) will occur.java.io.IOExceptionreadInternal(byte[],int,int)public java.lang.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 IndexInputCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.