public abstract class StreamInput
extends java.io.InputStream
Constructor and Description |
---|
StreamInput() |
Modifier and Type | Method and Description |
---|---|
abstract int |
available() |
abstract void |
close()
Closes the stream to further operations.
|
Version |
getVersion()
The version of the node on the other side of this stream.
|
AggregatorBuilder<?> |
readAggregatorFactory()
Reads a
AggregatorBuilder from the current stream |
boolean |
readBoolean()
Reads a boolean.
|
abstract byte |
readByte()
Reads and returns a single byte.
|
byte[] |
readByteArray() |
abstract void |
readBytes(byte[] b,
int offset,
int len)
Reads a specified number of bytes into an array at the specified offset.
|
org.apache.lucene.util.BytesRef |
readBytesRef() |
org.apache.lucene.util.BytesRef |
readBytesRef(int length) |
BytesReference |
readBytesReference()
Reads a bytes reference from this stream, might hold an actual reference to the underlying
bytes of the stream.
|
BytesReference |
readBytesReference(int length)
Reads a bytes reference from this stream, might hold an actual reference to the underlying
bytes of the stream.
|
double |
readDouble() |
double[] |
readDoubleArray() |
float |
readFloat() |
float[] |
readFloatArray() |
void |
readFully(byte[] b) |
java.lang.Object |
readGenericValue() |
GeoPoint |
readGeoPoint()
Reads a
GeoPoint from this stream input |
int |
readInt()
Reads four bytes and returns an int.
|
int[] |
readIntArray() |
<T> java.util.List<T> |
readList(StreamInputReader<T> reader)
Reads a list of objects
|
long |
readLong()
Reads eight bytes and returns a long.
|
long[] |
readLongArray() |
java.util.Map<java.lang.String,java.lang.Object> |
readMap() |
java.lang.Boolean |
readOptionalBoolean() |
BytesReference |
readOptionalBytesReference()
Reads an optional bytes reference from this stream.
|
java.lang.Float |
readOptionalFloat() |
QueryBuilder<?> |
readOptionalQuery()
Reads an optional
QueryBuilder . |
<T extends Streamable> |
readOptionalStreamable(java.util.function.Supplier<T> supplier)
Serializes a potential null value.
|
java.lang.String |
readOptionalString() |
java.lang.String[] |
readOptionalStringArray() |
Text |
readOptionalText() |
java.lang.Integer |
readOptionalVInt() |
<T extends Writeable> |
readOptionalWriteable(Writeable.Reader<T> reader) |
SmoothingModel |
readPhraseSuggestionSmoothingModel()
Reads a
SmoothingModel from the current stream |
PipelineAggregatorBuilder<?> |
readPipelineAggregatorFactory()
Reads a
PipelineAggregatorBuilder from the current stream |
QueryBuilder<?> |
readQuery()
Reads a
QueryBuilder from the current stream |
RescoreBuilder<?> |
readRescorer()
Reads a
RescoreBuilder from the current stream |
ScoreFunctionBuilder<?> |
readScoreFunction()
Reads a
ScoreFunctionBuilder from the current stream |
ShapeBuilder |
readShape()
Reads a
ShapeBuilder from the current stream |
short |
readShort() |
SortBuilder<?> |
readSortBuilder()
Reads a
SortBuilder from the current stream |
java.lang.String |
readString() |
java.lang.String[] |
readStringArray() |
SuggestionBuilder<?> |
readSuggestion()
Reads a
SuggestionBuilder from the current stream |
Task.Status |
readTaskStatus()
Reads a
Task.Status from the current stream. |
Text |
readText() |
<T extends java.lang.Throwable> |
readThrowable() |
int |
readVInt()
Reads an int stored in variable-length format.
|
int[] |
readVIntArray() |
long |
readVLong()
Reads a long stored in variable-length format.
|
long[] |
readVLongArray() |
long |
readZLong() |
abstract void |
reset()
Resets the stream.
|
void |
setVersion(Version version)
Set the version of the node on the other side of this stream.
|
static StreamInput |
wrap(byte[] bytes) |
static StreamInput |
wrap(byte[] bytes,
int offset,
int length) |
static StreamInput |
wrap(BytesReference reference) |
public Version getVersion()
public void setVersion(Version version)
public abstract byte readByte() throws java.io.IOException
java.io.IOException
public abstract void readBytes(byte[] b, int offset, int len) throws java.io.IOException
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 BytesReference readBytesReference() throws java.io.IOException
java.io.IOException
public BytesReference readOptionalBytesReference() throws java.io.IOException
readBytesReference()
and
StreamOutput.writeBytesReference(BytesReference)
if you do not.java.io.IOException
public BytesReference readBytesReference(int length) throws java.io.IOException
java.io.IOException
public org.apache.lucene.util.BytesRef readBytesRef() throws java.io.IOException
java.io.IOException
public org.apache.lucene.util.BytesRef readBytesRef(int length) throws java.io.IOException
java.io.IOException
public void readFully(byte[] b) throws java.io.IOException
java.io.IOException
public short readShort() throws java.io.IOException
java.io.IOException
public int readInt() throws java.io.IOException
java.io.IOException
public int readVInt() throws java.io.IOException
readInt()
java.io.IOException
public long readLong() throws java.io.IOException
java.io.IOException
public long readVLong() throws java.io.IOException
java.io.IOException
public long readZLong() throws java.io.IOException
java.io.IOException
@Nullable public Text readOptionalText() throws java.io.IOException
java.io.IOException
public Text readText() throws java.io.IOException
java.io.IOException
@Nullable public java.lang.String readOptionalString() throws java.io.IOException
java.io.IOException
@Nullable public java.lang.Float readOptionalFloat() throws java.io.IOException
java.io.IOException
@Nullable public java.lang.Integer readOptionalVInt() throws java.io.IOException
java.io.IOException
public java.lang.String readString() throws java.io.IOException
java.io.IOException
public final float readFloat() throws java.io.IOException
java.io.IOException
public final double readDouble() throws java.io.IOException
java.io.IOException
public final boolean readBoolean() throws java.io.IOException
java.io.IOException
@Nullable public final java.lang.Boolean readOptionalBoolean() throws java.io.IOException
java.io.IOException
public abstract void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public abstract void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public abstract int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public java.lang.String[] readStringArray() throws java.io.IOException
java.io.IOException
public java.lang.String[] readOptionalStringArray() throws java.io.IOException
java.io.IOException
@Nullable public java.util.Map<java.lang.String,java.lang.Object> readMap() throws java.io.IOException
java.io.IOException
@Nullable public java.lang.Object readGenericValue() throws java.io.IOException
java.io.IOException
public GeoPoint readGeoPoint() throws java.io.IOException
GeoPoint
from this stream inputjava.io.IOException
public int[] readIntArray() throws java.io.IOException
java.io.IOException
public int[] readVIntArray() throws java.io.IOException
java.io.IOException
public long[] readLongArray() throws java.io.IOException
java.io.IOException
public long[] readVLongArray() throws java.io.IOException
java.io.IOException
public float[] readFloatArray() throws java.io.IOException
java.io.IOException
public double[] readDoubleArray() throws java.io.IOException
java.io.IOException
public byte[] readByteArray() throws java.io.IOException
java.io.IOException
public <T extends Streamable> T readOptionalStreamable(java.util.function.Supplier<T> supplier) throws java.io.IOException
java.io.IOException
public <T extends Writeable> T readOptionalWriteable(Writeable.Reader<T> reader) throws java.io.IOException
java.io.IOException
public <T extends java.lang.Throwable> T readThrowable() throws java.io.IOException
java.io.IOException
public AggregatorBuilder<?> readAggregatorFactory() throws java.io.IOException
AggregatorBuilder
from the current streamjava.io.IOException
public PipelineAggregatorBuilder<?> readPipelineAggregatorFactory() throws java.io.IOException
PipelineAggregatorBuilder
from the current streamjava.io.IOException
public QueryBuilder<?> readQuery() throws java.io.IOException
QueryBuilder
from the current streamjava.io.IOException
public QueryBuilder<?> readOptionalQuery() throws java.io.IOException
QueryBuilder
.java.io.IOException
public ShapeBuilder readShape() throws java.io.IOException
ShapeBuilder
from the current streamjava.io.IOException
public RescoreBuilder<?> readRescorer() throws java.io.IOException
RescoreBuilder
from the current streamjava.io.IOException
public SuggestionBuilder<?> readSuggestion() throws java.io.IOException
SuggestionBuilder
from the current streamjava.io.IOException
public SortBuilder<?> readSortBuilder() throws java.io.IOException
SortBuilder
from the current streamjava.io.IOException
public ScoreFunctionBuilder<?> readScoreFunction() throws java.io.IOException
ScoreFunctionBuilder
from the current streamjava.io.IOException
public SmoothingModel readPhraseSuggestionSmoothingModel() throws java.io.IOException
SmoothingModel
from the current streamjava.io.IOException
public Task.Status readTaskStatus() throws java.io.IOException
Task.Status
from the current stream.java.io.IOException
public <T> java.util.List<T> readList(StreamInputReader<T> reader) throws java.io.IOException
java.io.IOException
public static StreamInput wrap(BytesReference reference)
public static StreamInput wrap(byte[] bytes)
public static StreamInput wrap(byte[] bytes, int offset, int length)