Class ByteBufferOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
org.wildfly.clustering.marshalling.ByteBufferOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
An output stream for writing to a byte buffer.
- Author:
- Paul Ferraro
-
Field Summary
Fields inherited from class ByteArrayOutputStream
buf, count -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new output stream with an default initial capacity.ByteBufferOutputStream(int capacity) Constructs a new output stream with the specified initial capacity.ByteBufferOutputStream(OptionalInt capacity) Constructs a new output stream with an optional initial capacity. -
Method Summary
Modifier and TypeMethodDescriptionReturns the internal buffer of this output stream.Methods inherited from class ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, toString, write, write, writeBytes, writeToMethods inherited from class OutputStream
flush, nullOutputStream, write
-
Constructor Details
-
ByteBufferOutputStream
public ByteBufferOutputStream()Constructs a new output stream with an default initial capacity. -
ByteBufferOutputStream
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
Returns the internal buffer of this output stream.- Returns:
- the internal byte buffer.
-