public class OpenBufferOutputStream extends ByteArrayOutputStream
ByteArrayOutputStream which allows direct
access to the underlying byte buffer. If left on it's own, BAOS will copy
the entire buffer every time you access it. Basically, we lose a bit a
safety in order to gain a ton of performance. So be careful!buf, count| Constructor and Description |
|---|
OpenBufferOutputStream()
Initializes a new buffer stream.
|
OpenBufferOutputStream(int size)
Initializes a new buffer stream, with the specified buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
asInputStream()
Utility method used to create an appropriately sized stream based off
of the underlying buffer.
|
byte[] |
getBuffer()
Retrieves the raw byte buffer underneath the covers.
|
int |
getCount()
Returns the valid number of bytes written to the buffer.
|
close, reset, size, toByteArray, toString, toString, toString, write, write, writeToflush, writepublic OpenBufferOutputStream()
public OpenBufferOutputStream(int size)
size - initial size of the buffer.public byte[] getBuffer()
public int getCount()
public InputStream asInputStream()
Copyright © 2011-2016 OpenESB Community. All Rights Reserved.