Class InputStreamStreamInput
org.elasticsearch.common.io.stream.StreamInput
org.elasticsearch.common.io.stream.InputStreamStreamInput
- All Implemented Interfaces:
,
-
Constructor Summary
ConstructorDescriptionis)
Creates a new InputStreamStreamInput with unlimited sizeis, long sizeLimit)
Creates a new InputStreamStreamInput with a size limit -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
Closes the stream to further operations.protected void
ensureCanReadBytes(int length)
This method throws an if the given number of bytes can not be read from the this stream.void
mark(int readlimit)
boolean
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
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()
long
skip(long n)
Methods inherited from class org.elasticsearch.common.io.stream.StreamInput
getVersion, namedWriteableRegistry, readArray, readArraySize, readBigInteger, readBoolean, readByteArray, readBytesRef, readBytesRef, readBytesReference, readBytesReference, readDouble, readDoubleArray, readEnum, readEnumSet, readException, readFloat, readFloatArray, readFully, readGenericValue, readGeoPoint, readImmutableMap, readInstant, readInt, readIntArray, readList, readLong, readLongArray, readMap, readMap, readMapOfLists, readNamedWriteable, readNamedWriteable, readNamedWriteableList, readOptionalArray, readOptionalBoolean, readOptionalBytesReference, readOptionalDouble, readOptionalEnum, readOptionalFloat, readOptionalInstant, readOptionalInt, readOptionalLong, readOptionalNamedWriteable, readOptionalSecureString, readOptionalString, readOptionalStringArray, readOptionalStringList, readOptionalText, readOptionalTimeValue, readOptionalTimeZone, readOptionalVInt, readOptionalVLong, readOptionalWriteable, readOptionalZoneId, readOrderedMap, readReleasableBytesReference, readSecureString, readSet, readShort, readString, readStringArray, readStringList, readText, readTimeValue, readTimeZone, readVInt, readVIntArray, readVIntSlow, readVLong, readVLongArray, readVLongSlow, readZLong, readZoneId, setVersion, throwOnBrokenVInt, throwOnBrokenVLong, wrap, wrap
Methods inherited from class java.io.
, , , , ,
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Constructor Details
-
InputStreamStreamInput
public InputStreamStreamInput( is)Creates a new InputStreamStreamInput with unlimited size- Parameters:
is
- the input stream to wrap
-
InputStreamStreamInput
public InputStreamStreamInput( is, long sizeLimit)Creates a new InputStreamStreamInput with a size limit- Parameters:
is
- the input stream to wrapsizeLimit
- a hard limit of the number of bytes in the given input stream. This is used for internal input validation
-
-
Method Details
-
readByte
public byte readByte() throwsDescription copied from class:StreamInput
Reads and returns a single byte.- Specified by:
readByte
in classStreamInput
- Throws:
-
readBytes
public void readBytes(byte[] b, int offset, int len) throwsDescription copied from class:StreamInput
Reads a specified number of bytes into an array at the specified offset.- Specified by:
readBytes
in 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:
-
reset
public void reset() throws- Overrides:
in class
- Throws:
-
markSupported
public boolean markSupported()- Overrides:
in class
-
mark
public void mark(int readlimit)- Overrides:
in class
-
close
public void close() throwsDescription copied from class:StreamInput
Closes the stream to further operations.- Specified by:
in interface
- Specified by:
in interface
- Specified by:
close
in classStreamInput
- Throws:
-
available
public int available() throws- Specified by:
available
in classStreamInput
- Throws:
-
read
public int read() throws- Specified by:
in class
- Throws:
-
read
public int read(byte[] b) throws- Overrides:
in class
- Throws:
-
read
public int read(byte[] b, int off, int len) throws- Overrides:
in class
- Throws:
-
skip
public long skip(long n) throws- Overrides:
in class
- Throws:
-
ensureCanReadBytes
protected void ensureCanReadBytes(int length) throwsDescription copied from class:StreamInput
This method throws an 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.- Specified by:
ensureCanReadBytes
in classStreamInput
- Throws:
-