public abstract class CustomBufferedIndexInput extends IndexInput
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buffer |
static int |
BUFFER_SIZE |
Constructor and Description |
---|
CustomBufferedIndexInput(String resourceDesc) |
CustomBufferedIndexInput(String resourceDesc,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
IndexInput |
clone() |
void |
close() |
protected abstract void |
closeInternal() |
protected int |
flushBuffer(IndexOutput out,
long numBytes)
Flushes the in-memory bufer to the given output, copying at most
numBytes . |
long |
getFilePointer() |
byte |
readByte() |
void |
readBytes(byte[] b,
int offset,
int len) |
void |
readBytes(byte[] b,
int offset,
int len,
boolean useBuffer) |
int |
readInt() |
protected abstract void |
readInternal(byte[] b,
int offset,
int length)
Expert: implements buffer refill.
|
long |
readLong() |
int |
readVInt() |
long |
readVLong() |
void |
seek(long pos) |
protected abstract void |
seekInternal(long pos)
Expert: implements seek.
|
IndexInput |
slice(String sliceDescription,
long offset,
long length) |
length, randomAccessSlice, toString
readShort, readString, readStringSet, readStringStringMap, readZInt, readZLong, skipBytes
public static final int BUFFER_SIZE
protected byte[] buffer
public CustomBufferedIndexInput(String resourceDesc)
public CustomBufferedIndexInput(String resourceDesc, int bufferSize)
public byte readByte() throws IOException
readByte
in class DataInput
IOException
public void readBytes(byte[] b, int offset, int len) throws IOException
readBytes
in class DataInput
IOException
public void readBytes(byte[] b, int offset, int len, boolean useBuffer) throws IOException
readBytes
in class DataInput
IOException
public int readInt() throws IOException
readInt
in class DataInput
IOException
public long readLong() throws IOException
readLong
in class DataInput
IOException
public int readVInt() throws IOException
readVInt
in class DataInput
IOException
public long readVLong() throws IOException
readVLong
in class DataInput
IOException
public final void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class IndexInput
IOException
protected abstract void closeInternal() 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 readIOException
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 IndexInput clone()
clone
in class IndexInput
public IndexInput slice(String sliceDescription, long offset, long length) throws IOException
slice
in class IndexInput
IOException
protected int flushBuffer(IndexOutput out, long numBytes) throws IOException
numBytes
.
NOTE: this method does not refill the buffer, however it does advance the buffer position.
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.