Package com.esotericsoftware.kryo.io
Class OutputChunked
- java.lang.Object
-
- java.io.OutputStream
-
- com.esotericsoftware.kryo.io.Output
-
- com.esotericsoftware.kryo.io.OutputChunked
-
- All Implemented Interfaces:
Pool.Poolable
,java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class OutputChunked extends Output
AnOutput
that writes the length before each flush. The length allows the chunks to be skipped when reading.- Author:
- Nathan Sweet
-
-
Field Summary
-
Fields inherited from class com.esotericsoftware.kryo.io.Output
buffer, capacity, maxCapacity, outputStream, position, total, varEncoding
-
-
Constructor Summary
Constructors Constructor Description OutputChunked()
OutputChunked(int bufferSize)
OutputChunked(java.io.OutputStream outputStream)
OutputChunked(java.io.OutputStream outputStream, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endChunk()
Marks the curent written data as the end of a chunk.void
flush()
Flushes the buffered bytes.-
Methods inherited from class com.esotericsoftware.kryo.io.Output
close, getBuffer, getMaxCapacity, getOutputStream, getVariableLengthEncoding, intLength, longLength, position, require, reset, setBuffer, setBuffer, setOutputStream, setPosition, setVariableLengthEncoding, toBytes, total, varIntLength, varLongLength, write, write, write, writeAscii, writeBoolean, writeBooleans, writeByte, writeByte, writeBytes, writeBytes, writeChar, writeChars, writeDouble, writeDoubles, writeFloat, writeFloats, writeInt, writeInt, writeInts, writeInts, writeLong, writeLong, writeLongs, writeLongs, writeShort, writeShorts, writeString, writeVarDouble, writeVarFloat, writeVarInt, writeVarIntFlag, writeVarLong
-
-
-
-
Constructor Detail
-
OutputChunked
public OutputChunked()
- See Also:
Output()
-
OutputChunked
public OutputChunked(int bufferSize)
- See Also:
Output(int)
-
OutputChunked
public OutputChunked(java.io.OutputStream outputStream)
- See Also:
Output(OutputStream)
-
OutputChunked
public OutputChunked(java.io.OutputStream outputStream, int bufferSize)
- See Also:
Output(OutputStream, int)
-
-
Method Detail
-
flush
public void flush() throws KryoException
Description copied from class:Output
Flushes the buffered bytes. The default implementation writes the buffered bytes to theOutputStream
, if any, and sets the position to 0. Can be overridden to flush the bytes somewhere else.- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classOutput
- Throws:
KryoException
-
endChunk
public void endChunk()
Marks the curent written data as the end of a chunk. This chunk can then be skipped when reading.
-
-