| java.io.ByteArrayOutputStream com.sun.jbi.messaging.util.OpenBufferOutputStream
OpenBufferOutputStream | public class OpenBufferOutputStream extends java.io.ByteArrayOutputStream (Code) | | Special version of 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!
author: Sun Microsystems, Inc. |
Method Summary | |
public InputStream | asInputStream() Utility method used to create an appropriately sized stream based off
of the underlying buffer. | public byte[] | getBuffer() Retrieves the raw byte buffer underneath the covers.
raw bytes underlying the buffer. | public int | getCount() Returns the valid number of bytes written to the buffer. |
OpenBufferOutputStream | public OpenBufferOutputStream()(Code) | | Initializes a new buffer stream.
|
OpenBufferOutputStream | public OpenBufferOutputStream(int size)(Code) | | Initializes a new buffer stream, with the specified buffer size.
Parameters: size - initial size of the buffer. |
asInputStream | public InputStream asInputStream()(Code) | | Utility method used to create an appropriately sized stream based off
of the underlying buffer. The stream is clipped to size, so it will not
contain any garbage bytes from the end of the buffer.
input stream pointing to bytes in the buffer |
getBuffer | public byte[] getBuffer()(Code) | | Retrieves the raw byte buffer underneath the covers.
raw bytes underlying the buffer. |
getCount | public int getCount()(Code) | | Returns the valid number of bytes written to the buffer.
number of valid bytes in the buffer. |
|
|