|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--org.mortbay.http.HttpOutputStream
HTTP Http OutputStream. Acts as a BufferedOutputStream until setChunking() is called. Once chunking is enabled, the raw stream is chunk encoded as per RFC2616. Implements the following HTTP and Servlet features:
Field Summary | |
static java.lang.Class[] |
__filterArg
|
Fields inherited from interface org.mortbay.util.OutputObserver |
__CLOSED, __CLOSING, __COMMITING, __FIRST_WRITE, __RESET_BUFFER |
Constructor Summary | |
HttpOutputStream(java.io.OutputStream outputStream)
Constructor. |
|
HttpOutputStream(java.io.OutputStream outputStream,
int bufferSize)
Constructor. |
|
HttpOutputStream(java.io.OutputStream outputStream,
int bufferSize,
int headerReserve)
Constructor. |
Method Summary | |
void |
addObserver(OutputObserver observer)
Add an Output Observer. |
void |
addObserver(OutputObserver observer,
java.lang.Object data)
Add an Output Observer. |
void |
close()
Close the stream. |
void |
destroy()
|
void |
flush()
|
int |
getBufferSize()
Get the output buffer capacity. |
int |
getBytesWritten()
|
java.io.OutputStream |
getFilterStream()
Get Filter OutputStream. |
java.io.OutputStream |
getOutputStream()
Get the backing output stream. |
java.io.Writer |
getWriter(java.lang.String encoding)
|
boolean |
isChunking()
Get chunking mode |
boolean |
isClosed()
Close the stream. |
boolean |
isNullOutput()
is the output Nulled? |
boolean |
isWritten()
Has any data been written to the stream. |
void |
nullOutput()
Null the output. |
void |
outputNotify(java.io.OutputStream out,
int action,
java.lang.Object ignoredData)
Output Notification. |
void |
resetBuffer()
Reset Buffered output. |
void |
resetObservers()
Reset the observers. |
void |
resetStream()
Reset the stream. |
void |
setBufferedOutputStream(BufferedOutputStream bos,
boolean bufferHeaders)
|
void |
setBufferSize(int size)
Set the output buffer size. |
void |
setChunking()
Set chunking mode. |
void |
setFilterStream(java.io.OutputStream filter)
Set Filter OutputStream. |
void |
setTrailer(HttpFields trailer)
Set the trailer to send with a chunked close. |
java.lang.String |
toString()
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(java.io.InputStream in,
int len)
|
void |
write(int b)
|
void |
writeHeader(HttpMessage httpMessage)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.Class[] __filterArg
Constructor Detail |
public HttpOutputStream(java.io.OutputStream outputStream)
outputStream
- The outputStream to buffer or chunk to.public HttpOutputStream(java.io.OutputStream outputStream, int bufferSize)
outputStream
- The outputStream to buffer or chunk to.public HttpOutputStream(java.io.OutputStream outputStream, int bufferSize, int headerReserve)
outputStream
- The outputStream to buffer or chunk to.Method Detail |
public void setBufferedOutputStream(BufferedOutputStream bos, boolean bufferHeaders)
public java.io.OutputStream getOutputStream()
public java.io.OutputStream getFilterStream()
public void setFilterStream(java.io.OutputStream filter)
public boolean isWritten()
public int getBufferSize()
public void setBufferSize(int size) throws java.lang.IllegalStateException
size
- Minimum buffer size in bytes
java.lang.IllegalStateException
- If output has been written.public int getBytesWritten()
public void resetBuffer() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public void addObserver(OutputObserver observer)
observer
- The observer.public void addObserver(OutputObserver observer, java.lang.Object data)
observer
- The observer.data
- Data to be passed wit notify calls.public void resetObservers()
public void nullOutput() throws java.io.IOException
java.io.IOException
public boolean isNullOutput() throws java.io.IOException
java.io.IOException
public void setChunking()
public boolean isChunking()
public void resetStream() throws java.io.IOException, java.lang.IllegalStateException
java.lang.IllegalStateException
- The stream cannot be
reset if chunking is enabled.
java.io.IOException
public void destroy()
public void setTrailer(HttpFields trailer)
trailer
- public void writeHeader(HttpMessage httpMessage) throws java.io.IOException
writeHeader
in interface HttpMessage.HeaderWriter
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in class java.io.FilterOutputStream
java.io.IOException
public boolean isClosed() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in class java.io.FilterOutputStream
java.io.IOException
public void outputNotify(java.io.OutputStream out, int action, java.lang.Object ignoredData) throws java.io.IOException
outputNotify
in interface OutputObserver
out
- The OutputStream that caused the eventaction
- The action takenignoredData
- Data associated with the event.
java.io.IOException
public void write(java.io.InputStream in, int len) throws java.io.IOException
java.io.IOException
public java.io.Writer getWriter(java.lang.String encoding) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |