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, writeTo
protected 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.HeaderWriter
IOException
public void write(byte[] b) throws IOException
write
in class ByteBufferOutputStream
IOException
public void write(byte[] b, int offset, int length) throws IOException
write
in class ByteBufferOutputStream
IOException
protected void bypassWrite(byte[] b, int offset, int length) throws IOException
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class ByteBufferOutputStream
IOException
protected void wrapBuffer() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class ByteBufferOutputStream
IOException
public void resetStream()
resetStream
in class ByteBufferOutputStream
public void destroy()
destroy
in class ByteBufferOutputStream
Copyright © 2016. All Rights Reserved.