Class FilterStreamInput
java.lang.Object
java.io.InputStream
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.FilterStreamInput
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
BufferedChecksumStreamInput,NamedWriteableAwareStreamInput
public abstract class FilterStreamInput extends StreamInput
Wraps a
StreamInput and delegates to it. To be used to add functionality to an existing stream by subclassing.-
Field Summary
Fields Modifier and Type Field Description protected StreamInputdelegate -
Constructor Summary
Constructors Modifier Constructor Description protectedFilterStreamInput(StreamInput delegate) -
Method Summary
Modifier and Type Method Description intavailable()voidclose()Closes the stream to further operations.protected voidensureCanReadBytes(int length)This method throws anEOFExceptionif the given number of bytes can not be read from the this stream.VersiongetVersion()The version of the node on the other side of this stream.NamedWriteableRegistrynamedWriteableRegistry()Get the registry of named writeables if this stream has one,nullotherwise.intread()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.intreadInt()Reads four bytes and returns an int.longreadLong()Reads eight bytes and returns a long.shortreadShort()voidreset()voidsetVersion(Version version)Set the version of the node on the other side of this stream.Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
readArray, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readInstant, readIntArray, readList, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalFloat, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalStringList, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalVLong, readOptionalWriteable, readOptionalZoneId, readSecureString, readSet, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVInt, readVIntArray, readVLong, readVLongArray, readZLong, readZoneId, wrap, wrap
-
Field Details
-
Constructor Details
-
Method Details
-
readByte
public byte readByte() throws java.io.IOExceptionDescription copied from class:StreamInputReads and returns a single byte.- Specified by:
readBytein classStreamInput- Throws:
java.io.IOException
-
readBytes
public void readBytes(byte[] b, int offset, int len) throws java.io.IOExceptionDescription copied from class:StreamInputReads a specified number of bytes into an array at the specified offset.- Specified by:
readBytesin classStreamInput- 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
-
readShort
public short readShort() throws java.io.IOException- Overrides:
readShortin classStreamInput- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOExceptionDescription copied from class:StreamInputReads four bytes and returns an int.- Overrides:
readIntin classStreamInput- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOExceptionDescription copied from class:StreamInputReads eight bytes and returns a long.- Overrides:
readLongin classStreamInput- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDescription copied from class:StreamInputCloses the stream to further operations.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classStreamInput- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Specified by:
availablein classStreamInput- Throws:
java.io.IOException
-
getVersion
Description copied from class:StreamInputThe version of the node on the other side of this stream.- Overrides:
getVersionin classStreamInput
-
setVersion
Description copied from class:StreamInputSet the version of the node on the other side of this stream.- Overrides:
setVersionin classStreamInput
-
ensureCanReadBytes
protected void ensureCanReadBytes(int length) throws java.io.EOFExceptionDescription copied from class:StreamInputThis method throws anEOFExceptionif 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.- Specified by:
ensureCanReadBytesin classStreamInput- Throws:
java.io.EOFException
-
namedWriteableRegistry
Description copied from class:StreamInputGet the registry of named writeables if this stream has one,nullotherwise.- Overrides:
namedWriteableRegistryin classStreamInput
-