org.mortbay.http
Class BufferedOutputStream
- HttpMessage.HeaderWriter
public class BufferedOutputStream
Buffered Output Stream.
Uses ByteBufferOutputStream to allow pre and post writes.
BufferedOutputStream(OutputStream out, int capacity, int headerReserve, int preReserve, int postReserve) - Constructor.
|
bufferSize , capacity , close , destroy , ensureCapacity , ensureReserve , ensureSize , ensureSize , ensureSpareCapacity , flush , isFixed , postReserve , postwrite , preReserve , prewrite , prewrite , prewrite , reset , resetStream , setFixed , size , spareCapacity , write , write , write , writeTo |
_out
protected OutputStream _out
BufferedOutputStream
public BufferedOutputStream(OutputStream out,
int capacity,
int headerReserve,
int preReserve,
int postReserve)
Constructor.
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 appending
bypassWrite
protected void bypassWrite(byte[] b,
int offset,
int length)
throws IOException
flush
public void flush()
throws IOException
This implementation calls the commitObserver on the first flush since
construction or reset.
- flush in interface ByteBufferOutputStream
getBypassBuffer
public boolean getBypassBuffer()
- If true, the buffer is bypassed for large writes
to a committed stream.
getCommitObserver
public OutputObserver getCommitObserver()
- OutputObserver to receives commit events from this stream.
getOutputStream
public OutputStream getOutputStream()
isCommitted
public boolean isCommitted()
setBypassBuffer
public void setBypassBuffer(boolean bypassBuffer)
bypassBuffer
- If true, the buffer is bypassed for large writes
to a committed stream.
setCommitObserver
public void setCommitObserver(OutputObserver commitObserver)
commitObserver
- OutputObserver to receives commit events from this stream.
wrapBuffer
protected void wrapBuffer()
throws IOException
Wrap Buffer.
Called by flush() to allow the data in the buffer to be pre and post
written for any protocol wrapping. The default implementation does
nothing.
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.