ByteBufferPool or freshly allocated if one is not supplied.
Designed to mimic java.io.ByteArrayOutputStream but with better memory usage, and less copying.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufferAccumulator | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| public int | |
| public RetainableByteBuffer | Returns: a buffer containing all content written to the OutputStream.Take the combined buffer containing all content written to the OutputStream. |
| public byte[] | Returns: a newly allocated byte array containing all content written into the OutputStream.
|
| public RetainableByteBuffer | Returns: a buffer containing all content written to the OutputStream.Take the combined buffer containing all content written to the OutputStream. |
| public synchronized String | |
| public void | write(int
the b)byte.Implements abstract java. |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. len bytes from the specified byte array
starting at offset off to this output stream.
|
| public void | |
| public void | |
| public void |
| _accumulator | back to summary |
|---|---|
| private final ByteBufferAccumulator _accumulator | |
| _size | back to summary |
|---|---|
| private int _size | |
| ByteBufferOutputStream2 | back to summary |
|---|---|
| public ByteBufferOutputStream2() | |
| ByteBufferOutputStream2 | back to summary |
|---|---|
| public ByteBufferOutputStream2(ByteBufferPool bufferPool, boolean direct) | |
| close | back to summary |
|---|---|
| public void close() Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| size | back to summary |
|---|---|
| public int size() | |
| takeByteBuffer | back to summary |
|---|---|
| public RetainableByteBuffer takeByteBuffer() Take the combined buffer containing all content written to the OutputStream.
The caller is responsible for releasing this
| |
| toByteArray | back to summary |
|---|---|
public byte[] toByteArray()
| |
| toByteBuffer | back to summary |
|---|---|
| public RetainableByteBuffer toByteBuffer() Take the combined buffer containing all content written to the OutputStream. The returned buffer is still contained within the OutputStream and will be released when the OutputStream is closed.
| |
| toString | back to summary |
|---|---|
| public synchronized String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| write | back to summary |
|---|---|
| public void write(int b) Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public void write(ByteBuffer buffer) | |
| writeTo | back to summary |
|---|---|
| public void writeTo(ByteBuffer buffer) | |
| writeTo | back to summary |
|---|---|
| public void writeTo(OutputStream out) throws IOException | |