public abstract class StreamInput extends 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() |
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) |
Object |
readGenericValue() |
GeoPoint |
readGeoPoint()
Reads a
GeoPoint from this stream input |
int |
readInt()
Reads four bytes and returns an int.
|
int[] |
readIntArray() |
<T> List<T> |
readList(StreamInputReader<T> reader)
Reads a list of objects
|
long |
readLong()
Reads eight bytes and returns a long.
|
long[] |
readLongArray() |
Map<String,Object> |
readMap() |
Boolean |
readOptionalBoolean() |
<T extends Streamable> |
readOptionalStreamable(T streamable)
Serializes a potential null value.
|
String |
readOptionalString() |
Text |
readOptionalText() |
Integer |
readOptionalVInt() |
short |
readShort() |
String |
readString() |
String[] |
readStringArray() |
Task.Status |
readTaskStatus()
Reads a
Task.Status from the current stream. |
Text |
readText() |
<T extends 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() |
abstract void |
reset()
Resets the stream.
|
void |
setVersion(Version version) |
static StreamInput |
wrap(byte[] bytes) |
static StreamInput |
wrap(byte[] bytes,
int offset,
int length) |
static StreamInput |
wrap(BytesReference reference) |
mark, markSupported, read, read, read, skip
public Version getVersion()
public void setVersion(Version version)
public abstract byte readByte() throws IOException
IOException
public abstract void readBytes(byte[] b, int offset, int len) throws IOException
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to readIOException
public BytesReference readBytesReference() throws IOException
IOException
public BytesReference readBytesReference(int length) throws IOException
IOException
public org.apache.lucene.util.BytesRef readBytesRef() throws IOException
IOException
public org.apache.lucene.util.BytesRef readBytesRef(int length) throws IOException
IOException
public void readFully(byte[] b) throws IOException
IOException
public short readShort() throws IOException
IOException
public int readInt() throws IOException
IOException
public int readVInt() throws IOException
readInt()
IOException
public long readLong() throws IOException
IOException
public long readVLong() throws IOException
IOException
@Nullable public Text readOptionalText() throws IOException
IOException
public Text readText() throws IOException
IOException
@Nullable public String readOptionalString() throws IOException
IOException
@Nullable public Integer readOptionalVInt() throws IOException
IOException
public String readString() throws IOException
IOException
public final float readFloat() throws IOException
IOException
public final double readDouble() throws IOException
IOException
public final boolean readBoolean() throws IOException
IOException
@Nullable public final Boolean readOptionalBoolean() throws IOException
IOException
public abstract void reset() throws IOException
reset
in class InputStream
IOException
public abstract void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public abstract int available() throws IOException
available
in class InputStream
IOException
public String[] readStringArray() throws IOException
IOException
@Nullable public Map<String,Object> readMap() throws IOException
IOException
@Nullable public Object readGenericValue() throws IOException
IOException
public GeoPoint readGeoPoint() throws IOException
GeoPoint
from this stream inputIOException
public int[] readIntArray() throws IOException
IOException
public int[] readVIntArray() throws IOException
IOException
public long[] readLongArray() throws IOException
IOException
public long[] readVLongArray() throws IOException
IOException
public float[] readFloatArray() throws IOException
IOException
public double[] readDoubleArray() throws IOException
IOException
public byte[] readByteArray() throws IOException
IOException
public <T extends Streamable> T readOptionalStreamable(T streamable) throws IOException
IOException
public <T extends Throwable> T readThrowable() throws IOException
IOException
public Task.Status readTaskStatus() throws IOException
Task.Status
from the current stream.IOException
public <T> List<T> readList(StreamInputReader<T> reader) throws IOException
IOException
public static StreamInput wrap(BytesReference reference)
public static StreamInput wrap(byte[] bytes)
public static StreamInput wrap(byte[] bytes, int offset, int length)
Copyright © 2009–2016. All rights reserved.