public abstract class CompressedStreamInput extends StreamInput
Modifier and Type | Field and Description |
---|---|
protected byte[] |
uncompressed |
Constructor and Description |
---|
CompressedStreamInput(StreamInput in) |
Modifier and Type | Method and Description |
---|---|
int |
available()
Method is overridden to report number of bytes that can now be read
from decoded data buffer, without reading bytes from the underlying
stream.
|
void |
close()
Closes the stream to further operations.
|
protected abstract void |
doClose() |
int |
read() |
int |
read(byte[] buffer,
int offset,
int length) |
int |
read(byte[] buffer,
int offset,
int length,
boolean fullRead) |
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.
|
protected abstract void |
readHeader(StreamInput in) |
protected boolean |
readyBuffer()
Fill the uncompressed bytes buffer by reading the underlying inputStream.
|
void |
reset()
Resets the stream.
|
void |
setVersion(Version version) |
protected abstract int |
uncompress(StreamInput in,
byte[] out)
Uncompress the data into the out array, returning the size uncompressed
|
getVersion, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readInt, readIntArray, readList, readLong, readLongArray, readMap, readOptionalBoolean, readOptionalStreamable, readOptionalString, readOptionalText, readOptionalVInt, readShort, readString, readStringArray, readTaskStatus, readText, readThrowable, readVInt, readVIntArray, readVLong, readVLongArray, wrap, wrap, wrap
mark, markSupported, read, skip
public CompressedStreamInput(StreamInput in) throws IOException
IOException
public void setVersion(Version version)
setVersion
in class StreamInput
public int available() throws IOException
available
in class StreamInput
IOException
public int read() throws IOException
read
in class InputStream
IOException
public byte readByte() throws IOException
StreamInput
readByte
in class StreamInput
IOException
public int read(byte[] buffer, int offset, int length) throws IOException
read
in class InputStream
IOException
public int read(byte[] buffer, int offset, int length, boolean fullRead) throws IOException
IOException
public void readBytes(byte[] b, int offset, int len) throws IOException
StreamInput
readBytes
in class StreamInput
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to readIOException
public void reset() throws IOException
StreamInput
reset
in class StreamInput
IOException
public void close() throws IOException
StreamInput
close
in interface Closeable
close
in interface AutoCloseable
close
in class StreamInput
IOException
protected abstract void doClose() throws IOException
IOException
protected boolean readyBuffer() throws IOException
IOException
protected abstract void readHeader(StreamInput in) throws IOException
IOException
protected abstract int uncompress(StreamInput in, byte[] out) throws IOException
IOException
Copyright © 2009–2016. All rights reserved.