Class ByteBufferOutputStream

java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.wildfly.clustering.marshalling.ByteBufferOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public final class ByteBufferOutputStream extends ByteArrayOutputStream
An output stream for writing to a byte buffer.
Author:
Paul Ferraro
  • Constructor Details

    • ByteBufferOutputStream

      public ByteBufferOutputStream()
      Constructs a new output stream with an default initial capacity.
    • ByteBufferOutputStream

      public ByteBufferOutputStream(OptionalInt capacity)
      Constructs a new output stream with an optional initial capacity.
      Parameters:
      capacity - an optional initial capacity
    • ByteBufferOutputStream

      public ByteBufferOutputStream(int capacity)
      Constructs a new output stream with the specified initial capacity.
      Parameters:
      capacity - the initial capacity
  • Method Details

    • getBuffer

      public ByteBuffer getBuffer()
      Returns the internal buffer of this output stream.
      Returns:
      the internal byte buffer.