Class OutputChunked

  • All Implemented Interfaces:
    Pool.Poolable, java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class OutputChunked
    extends Output
    An Output that writes the length before each flush. The length allows the chunks to be skipped when reading.
    Author:
    Nathan Sweet
    • 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 the OutputStream, if any, and sets the position to 0. Can be overridden to flush the bytes somewhere else.
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class Output
        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.