public abstract class StreamOutput extends OutputStream
Constructor and Description |
---|
StreamOutput() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Closes this stream to further operations.
|
abstract void |
flush()
Forces any buffered output to be written.
|
Version |
getVersion() |
long |
position() |
abstract void |
reset() |
void |
seek(long position) |
StreamOutput |
setVersion(Version version) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeBoolean(boolean b)
Writes a boolean.
|
abstract void |
writeByte(byte b)
Writes a single byte.
|
void |
writeByteArray(byte[] b)
Writes an array of bytes.
|
void |
writeBytes(byte[] b)
Writes an array of bytes.
|
void |
writeBytes(byte[] b,
int length)
Writes an array of bytes.
|
abstract void |
writeBytes(byte[] b,
int offset,
int length)
Writes an array of bytes.
|
void |
writeBytesRef(org.apache.lucene.util.BytesRef bytes) |
void |
writeBytesReference(BytesReference bytes)
Writes the bytes reference, including a length header.
|
void |
writeDouble(double v) |
void |
writeDoubleArray(double[] values) |
void |
writeFloat(float v) |
void |
writeFloatArray(float[] values) |
void |
writeGenericValue(Object value) |
void |
writeGeoPoint(GeoPoint geoPoint)
Writes the given
GeoPoint to the stream |
void |
writeInt(int i)
Writes an int as four bytes.
|
void |
writeIntArray(int[] values) |
<T extends Writeable<T>> |
writeList(List<T> list)
Writes a list of
Writeable objects |
void |
writeLong(long i)
Writes a long as eight bytes.
|
void |
writeLongArray(long[] values) |
void |
writeMap(Map<String,Object> map) |
void |
writeOptionalBoolean(Boolean b) |
void |
writeOptionalStreamable(Streamable streamable)
Serializes a potential null value.
|
void |
writeOptionalString(String str) |
void |
writeOptionalText(Text text) |
void |
writeOptionalVInt(Integer integer) |
void |
writeShort(short v) |
void |
writeString(String str) |
void |
writeStringArray(String[] array) |
void |
writeStringArrayNullable(String[] array)
Writes a string array, for nullable string, writes it as 0 (empty string).
|
void |
writeTaskStatus(Task.Status status)
Writes a
Task.Status to the current stream. |
void |
writeText(Text text) |
void |
writeThrowable(Throwable throwable) |
void |
writeVInt(int i)
Writes an int in a variable-length format.
|
void |
writeVIntArray(int[] values) |
void |
writeVLong(long i)
Writes an long in a variable-length format.
|
void |
writeVLongArray(long[] values) |
write
public Version getVersion()
public StreamOutput setVersion(Version version)
public long position() throws IOException
IOException
public void seek(long position) throws IOException
IOException
public abstract void writeByte(byte b) throws IOException
IOException
public void writeBytes(byte[] b) throws IOException
b
- the bytes to writeIOException
public void writeBytes(byte[] b, int length) throws IOException
b
- the bytes to writelength
- the number of bytes to writeIOException
public abstract void writeBytes(byte[] b, int offset, int length) throws IOException
b
- the bytes to writeoffset
- the offset in the byte arraylength
- the number of bytes to writeIOException
public void writeByteArray(byte[] b) throws IOException
b
- the bytes to writeIOException
public void writeBytesReference(@Nullable BytesReference bytes) throws IOException
IOException
public void writeBytesRef(org.apache.lucene.util.BytesRef bytes) throws IOException
IOException
public final void writeShort(short v) throws IOException
IOException
public void writeInt(int i) throws IOException
IOException
public void writeVInt(int i) throws IOException
writeInt(int)
IOException
public void writeLong(long i) throws IOException
IOException
public void writeVLong(long i) throws IOException
IOException
public void writeOptionalString(@Nullable String str) throws IOException
IOException
public void writeOptionalVInt(@Nullable Integer integer) throws IOException
IOException
public void writeOptionalText(@Nullable Text text) throws IOException
IOException
public void writeText(Text text) throws IOException
IOException
public void writeString(String str) throws IOException
IOException
public void writeFloat(float v) throws IOException
IOException
public void writeDouble(double v) throws IOException
IOException
public void writeBoolean(boolean b) throws IOException
IOException
public void writeOptionalBoolean(@Nullable Boolean b) throws IOException
IOException
public abstract void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public abstract void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public abstract void reset() throws IOException
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void writeStringArray(String[] array) throws IOException
IOException
public void writeStringArrayNullable(@Nullable String[] array) throws IOException
IOException
public void writeMap(@Nullable Map<String,Object> map) throws IOException
IOException
public void writeGenericValue(@Nullable Object value) throws IOException
IOException
public void writeIntArray(int[] values) throws IOException
IOException
public void writeVIntArray(int[] values) throws IOException
IOException
public void writeLongArray(long[] values) throws IOException
IOException
public void writeVLongArray(long[] values) throws IOException
IOException
public void writeFloatArray(float[] values) throws IOException
IOException
public void writeDoubleArray(double[] values) throws IOException
IOException
public void writeOptionalStreamable(@Nullable Streamable streamable) throws IOException
IOException
public void writeThrowable(Throwable throwable) throws IOException
IOException
public void writeTaskStatus(Task.Status status) throws IOException
Task.Status
to the current stream.IOException
public void writeGeoPoint(GeoPoint geoPoint) throws IOException
GeoPoint
to the streamIOException
public <T extends Writeable<T>> void writeList(List<T> list) throws IOException
Writeable
objectsIOException
Copyright © 2009–2016. All rights reserved.