org.mortbay.util
public class ByteBufferOutputStream extends OutputStream
Version: $Revision: 1.18 $
Field Summary | |
---|---|
protected byte[] | _buf |
Constructor Summary | |
---|---|
ByteBufferOutputStream() Constructor. | |
ByteBufferOutputStream(int capacity) Constructor. | |
ByteBufferOutputStream(int capacity, int preReserve) Constructor. | |
ByteBufferOutputStream(int bufferSize, int preReserve, int postReserve) Constructor. |
Method Summary | |
---|---|
int | bufferSize() |
int | capacity() |
void | close() |
void | destroy() |
void | ensureCapacity(int n) |
void | ensureReserve(int n) |
void | ensureSize(int bufSize) |
void | ensureSize(int bufSize, int pre, int post) |
void | ensureSpareCapacity(int n) |
void | flush() |
boolean | isFixed() |
int | postReserve() |
void | postwrite(byte b) Write bytes into the postreserve.
|
void | postwrite(byte[] b, int offset, int length) Write bytes into the postreserve.
|
int | preReserve() |
void | prewrite(int b) Write byte to start of the buffer. |
void | prewrite(byte[] b) Write byte array to start of the buffer. |
void | prewrite(byte[] b, int offset, int length) Write byte range to start of the buffer. |
void | reset(int reserve) |
void | resetStream() |
void | setFixed(boolean fixed) |
int | size() |
int | spareCapacity() |
void | write(int b) |
void | write(byte[] b) |
void | write(byte[] b, int offset, int length) |
void | writeTo(OutputStream out) |
Parameters: capacity Buffer capacity
Parameters: capacity Buffer capacity. preReserve The reserve of byte for prepending
Parameters: bufferSize The size of the buffer == capacity+preReserve+postReserve preReserve The reserve of byte for prepending postReserve The reserve of byte for appending
Returns: The size of the buffer.
Returns: The capacity of the buffer excluding pre and post reserves.
Returns: True if the buffer cannot be expanded
Returns: The current post reserve.
Parameters: b offset length
Throws: IOException
Parameters: b offset length
Throws: IOException
Returns: The current pre reserve.
Parameters: b
Parameters: b
Parameters: b offset length
Parameters: fixed True if the buffer cannot be expanded
Returns: The size of valid data in the buffer.
Returns: The available capacity of the buffer excluding pre and post reserves and data already written.