public abstract class FilterStreamInput extends StreamInput
StreamInput
and delegates to it. To be used to add functionality to an existing stream by subclassing.Modifier and Type | Field and Description |
---|---|
protected StreamInput |
delegate |
Modifier | Constructor and Description |
---|---|
protected |
FilterStreamInput(StreamInput delegate) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close()
Closes the stream to further operations.
|
protected void |
ensureCanReadBytes(int length)
This method throws an
EOFException if the given number of bytes can not be read from the this stream. |
Version |
getVersion()
The version of the node on the other side of this stream.
|
int |
read() |
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 |
reset() |
void |
setVersion(Version version)
Set the version of the node on the other side of this stream.
|
readArray, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readInt, readIntArray, readList, readLong, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalFloat, readOptionalLong, readOptionalNamedWriteable, readOptionalStreamable, readOptionalString, readOptionalStringArray, readOptionalText, readOptionalTimeZone, readOptionalVInt, readOptionalWriteable, readShort, readStreamableList, readString, readStringArray, readText, readTimeZone, readVInt, readVIntArray, readVLong, readVLongArray, readZLong, wrap, wrap
protected final StreamInput delegate
protected FilterStreamInput(StreamInput delegate)
public byte readByte() throws java.io.IOException
StreamInput
readByte
in class StreamInput
java.io.IOException
public void readBytes(byte[] b, int offset, int len) throws java.io.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 readjava.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
StreamInput
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class StreamInput
java.io.IOException
public int available() throws java.io.IOException
available
in class StreamInput
java.io.IOException
public Version getVersion()
StreamInput
getVersion
in class StreamInput
public void setVersion(Version version)
StreamInput
setVersion
in class StreamInput
protected void ensureCanReadBytes(int length) throws java.io.EOFException
StreamInput
EOFException
if the given number of bytes can not be read from the this stream. This method might
be a no-op depending on the underlying implementation if the information of the remaining bytes is not present.ensureCanReadBytes
in class StreamInput
java.io.EOFException