public class ByteBufferOutputStream
extends java.io.OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_buf |
| Constructor and Description |
|---|
ByteBufferOutputStream()
Constructor.
|
ByteBufferOutputStream(int capacity)
Constructor.
|
ByteBufferOutputStream(int capacity,
int preReserve)
Constructor.
|
ByteBufferOutputStream(int bufferSize,
int preReserve,
int postReserve)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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(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 |
prewrite(int b)
Write byte to start of the buffer.
|
void |
reset(int reserve) |
void |
resetStream() |
void |
setFixed(boolean fixed) |
int |
size() |
int |
spareCapacity() |
void |
write(byte[] b) |
void |
write(byte[] b,
int offset,
int length) |
void |
write(int b) |
void |
writeTo(java.io.OutputStream out) |
public ByteBufferOutputStream()
public ByteBufferOutputStream(int capacity)
capacity - Buffer capacitypublic ByteBufferOutputStream(int capacity,
int preReserve)
capacity - Buffer capacity.preReserve - The reserve of byte for prependingpublic ByteBufferOutputStream(int bufferSize,
int preReserve,
int postReserve)
bufferSize - The size of the buffer == capacity+preReserve+postReservepreReserve - The reserve of byte for prependingpostReserve - The reserve of byte for appendingpublic boolean isFixed()
public void setFixed(boolean fixed)
fixed - True if the buffer cannot be expandedpublic int size()
public int bufferSize()
public int capacity()
public int spareCapacity()
public int preReserve()
public int postReserve()
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int offset,
int length)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void prewrite(int b)
b - public void prewrite(byte[] b)
b - public void prewrite(byte[] b,
int offset,
int length)
b - offset - length - public void postwrite(byte b)
throws java.io.IOException
b - offset - length - java.io.IOExceptionpublic void postwrite(byte[] b,
int offset,
int length)
throws java.io.IOException
b - offset - length - java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void resetStream()
public void reset(int reserve)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic void destroy()
public void ensureReserve(int n)
public void ensureSize(int bufSize)
throws java.io.IOException
java.io.IOExceptionpublic void ensureSize(int bufSize,
int pre,
int post)
throws java.io.IOException
java.io.IOExceptionpublic void ensureSpareCapacity(int n)
throws java.io.IOException
java.io.IOExceptionpublic void ensureCapacity(int n)
throws java.io.IOException
java.io.IOExceptionCopyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.