public class BufferedOutputStream extends ByteBufferOutputStream implements HttpMessage.HeaderWriter
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayISO8859Writer |
_httpMessageWriter |
protected OutputStream |
_out |
_buf| Constructor and Description |
|---|
BufferedOutputStream(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() |
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 OutputStream _out
protected ByteArrayISO8859Writer _httpMessageWriter
public BufferedOutputStream(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 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 IOException
writeHeader in interface HttpMessage.HeaderWriterIOExceptionpublic void write(byte[] b)
throws IOException
write in class ByteBufferOutputStreamIOExceptionpublic void write(byte[] b,
int offset,
int length)
throws IOException
write in class ByteBufferOutputStreamIOExceptionprotected void bypassWrite(byte[] b,
int offset,
int length)
throws IOException
IOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class ByteBufferOutputStreamIOExceptionprotected void wrapBuffer()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ByteBufferOutputStreamIOExceptionpublic void resetStream()
resetStream in class ByteBufferOutputStreampublic void destroy()
destroy in class ByteBufferOutputStreamCopyright © 2013. All rights reserved.