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) |
writepublic Version getVersion()
public StreamOutput setVersion(Version version)
public long position()
throws IOException
IOExceptionpublic void seek(long position)
throws IOException
IOExceptionpublic abstract void writeByte(byte b)
throws IOException
IOExceptionpublic void writeBytes(byte[] b)
throws IOException
b - the bytes to writeIOExceptionpublic void writeBytes(byte[] b,
int length)
throws IOException
b - the bytes to writelength - the number of bytes to writeIOExceptionpublic 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 writeIOExceptionpublic void writeByteArray(byte[] b)
throws IOException
b - the bytes to writeIOExceptionpublic void writeBytesReference(@Nullable BytesReference bytes) throws IOException
IOExceptionpublic void writeBytesRef(org.apache.lucene.util.BytesRef bytes)
throws IOException
IOExceptionpublic final void writeShort(short v)
throws IOException
IOExceptionpublic void writeInt(int i)
throws IOException
IOExceptionpublic void writeVInt(int i)
throws IOException
writeInt(int)IOExceptionpublic void writeLong(long i)
throws IOException
IOExceptionpublic void writeVLong(long i)
throws IOException
IOExceptionpublic void writeOptionalString(@Nullable String str) throws IOException
IOExceptionpublic void writeOptionalVInt(@Nullable Integer integer) throws IOException
IOExceptionpublic void writeOptionalText(@Nullable Text text) throws IOException
IOExceptionpublic void writeText(Text text) throws IOException
IOExceptionpublic void writeString(String str) throws IOException
IOExceptionpublic void writeFloat(float v)
throws IOException
IOExceptionpublic void writeDouble(double v)
throws IOException
IOExceptionpublic void writeBoolean(boolean b)
throws IOException
IOExceptionpublic void writeOptionalBoolean(@Nullable Boolean b) throws IOException
IOExceptionpublic abstract void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic abstract void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic abstract void reset()
throws IOException
IOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void writeStringArray(String[] array) throws IOException
IOExceptionpublic void writeStringArrayNullable(@Nullable String[] array) throws IOException
IOExceptionpublic void writeMap(@Nullable Map<String,Object> map) throws IOException
IOExceptionpublic void writeGenericValue(@Nullable Object value) throws IOException
IOExceptionpublic void writeIntArray(int[] values)
throws IOException
IOExceptionpublic void writeVIntArray(int[] values)
throws IOException
IOExceptionpublic void writeLongArray(long[] values)
throws IOException
IOExceptionpublic void writeVLongArray(long[] values)
throws IOException
IOExceptionpublic void writeFloatArray(float[] values)
throws IOException
IOExceptionpublic void writeDoubleArray(double[] values)
throws IOException
IOExceptionpublic void writeOptionalStreamable(@Nullable Streamable streamable) throws IOException
IOExceptionpublic void writeThrowable(Throwable throwable) throws IOException
IOExceptionpublic void writeTaskStatus(Task.Status status) throws IOException
Task.Status to the current stream.IOExceptionpublic void writeGeoPoint(GeoPoint geoPoint) throws IOException
GeoPoint to the streamIOExceptionpublic <T extends Writeable<T>> void writeList(List<T> list) throws IOException
Writeable objectsIOExceptionCopyright © 2009–2017. All rights reserved.