Class ByteBufferOutputStream

java.lang.Object
java.io.OutputStream
com.esotericsoftware.kryo.io.ByteBufferOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class ByteBufferOutputStream extends OutputStream
An OutputStream whose target is a ByteBuffer. If bytes would be written that would overflow the buffer, OutputStream.flush() is called. Subclasses can override flush to empty the buffer.
  • Field Details

  • Constructor Details

    • ByteBufferOutputStream

      public ByteBufferOutputStream()
      Creates an uninitialized stream that cannot be used until setByteBuffer(ByteBuffer) is called.
    • ByteBufferOutputStream

      public ByteBufferOutputStream(int bufferSize)
      Creates a stream with a new non-direct buffer of the specified size.
    • ByteBufferOutputStream

      public ByteBufferOutputStream(ByteBuffer byteBuffer)
  • Method Details