public class BufferedOutputStream extends ByteBufferOutputStream implements HttpMessage.HeaderWriter
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayISO8859Writer |
_httpMessageWriter |
protected java.io.OutputStream |
_out |
_buf| Constructor and Description |
|---|
BufferedOutputStream(java.io.OutputStream out,
int capacity,
int headerReserve,
int preReserve,
int postReserve)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
bypassWrite(byte[] b,
int offset,
int length) |
void |
close() |
void |
destroy() |
void |
flush()
This implementation calls the commitObserver on the first flush since
construction or reset.
|
boolean |
getBypassBuffer() |
OutputObserver |
getCommitObserver() |
java.io.OutputStream |
getOutputStream() |
boolean |
isCommitted() |
void |
resetStream() |
void |
setBypassBuffer(boolean bypassBuffer) |
void |
setCommitObserver(OutputObserver commitObserver) |
protected void |
wrapBuffer()
Wrap Buffer.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int offset,
int length) |
void |
writeHeader(HttpMessage httpMessage) |
bufferSize, capacity, ensureCapacity, ensureReserve, ensureSize, ensureSize, ensureSpareCapacity, isFixed, postReserve, postwrite, postwrite, preReserve, prewrite, prewrite, prewrite, reset, setFixed, size, spareCapacity, write, writeToprotected java.io.OutputStream _out
protected ByteArrayISO8859Writer _httpMessageWriter
public BufferedOutputStream(java.io.OutputStream out,
int capacity,
int headerReserve,
int preReserve,
int postReserve)
out - the OutputStream to buffer to.capacity - Buffer capacity.headerReserve - The reserve of bytes for prepending to be used
for the first buffer after resetpreReserve - The reserve of bytes for prependingpostReserve - The reserve of bytes for appendingpublic java.io.OutputStream getOutputStream()
public OutputObserver getCommitObserver()
public void setCommitObserver(OutputObserver commitObserver)
commitObserver - OutputObserver to receives commit events from this stream.public boolean isCommitted()
public boolean getBypassBuffer()
public void setBypassBuffer(boolean bypassBuffer)
bypassBuffer - If true, the buffer is bypassed for large writes
to a committed stream.public void writeHeader(HttpMessage httpMessage) throws java.io.IOException
writeHeader in interface HttpMessage.HeaderWriterjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class ByteBufferOutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int offset,
int length)
throws java.io.IOException
write in class ByteBufferOutputStreamjava.io.IOExceptionprotected void bypassWrite(byte[] b,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class ByteBufferOutputStreamjava.io.IOExceptionprotected void wrapBuffer()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class ByteBufferOutputStreamjava.io.IOExceptionpublic void resetStream()
resetStream in class ByteBufferOutputStreampublic void destroy()
destroy in class ByteBufferOutputStreamCopyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.