|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.FilterOutputStream | +--org.mortbay.http.ChunkableOutputStream
HTTP Chunkable OutputStream. Acts as a BufferedOutputStream until setChunking(true) 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
|
Constructor Summary | |
ChunkableOutputStream(java.io.OutputStream outputStream)
Constructor. |
Method Summary | |
void |
addObserver(OutputObserver observer)
Add an Output Observer. |
void |
close()
Close the stream. |
void |
flush()
|
void |
flush(boolean endChunking)
|
int |
getBufferCapacity()
Get the output buffer capacity. |
int |
getBytesWritten()
|
java.io.OutputStream |
getRawStream()
Get the raw stream. |
java.io.Writer |
getRawWriter()
Get Writer for the raw stream. |
void |
insertFilter(java.lang.reflect.Constructor filter,
java.lang.Object[] args)
Insert FilterOutputStream. |
boolean |
isChunking()
Get chunking mode |
boolean |
isCommitted()
Has any data been sent from this stream. |
boolean |
isNullOutput()
is the output Nulled? |
boolean |
isWritten()
Has any data been written to the stream. |
void |
nullOutput()
Null the output. |
void |
print(java.lang.Object o)
|
void |
println()
|
void |
println(java.lang.Object o)
|
void |
resetBuffer()
Reset Buffered output. |
void |
resetStream()
Reset the stream. |
void |
setBufferCapacity(int capacity)
Set the output buffer capacity. |
void |
setChunking()
Set chunking mode. |
void |
setTrailer(HttpFields trailer)
Set the trailer to send with a chunked close. |
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(java.io.InputStream in,
int len)
|
void |
write(int b)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Class[] __filterArg
Constructor Detail |
public ChunkableOutputStream(java.io.OutputStream outputStream)
outputStream
- The outputStream to buffer or chunk to.Method Detail |
public java.io.OutputStream getRawStream()
public java.io.Writer getRawWriter()
public boolean isWritten()
public boolean isCommitted()
public int getBufferCapacity()
public void setBufferCapacity(int capacity) throws java.lang.IllegalStateException
capacity
- Minimum buffer capacity in bytesjava.lang.IllegalStateException
- If output has been written.public int getBytesWritten()
public void resetBuffer() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- Problem
- with observer notification.public void addObserver(OutputObserver observer)
observer
- The observer.public void nullOutput() throws java.io.IOException
public boolean isNullOutput() throws java.io.IOException
public void setChunking() throws java.io.IOException
public void resetStream() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The stream cannot be
reset if chunking is enabled.public boolean isChunking()
public void insertFilter(java.lang.reflect.Constructor filter, java.lang.Object[] args) throws java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
filter
- The Filter constructor. It must take an OutputStream
as the first arguement.arg
- Optional argument array to pass to filter constructor.
The first element of the array is replaced with the
current output stream.public void setTrailer(HttpFields trailer)
trailer
- public void write(int b) throws java.io.IOException
write
in class java.io.FilterOutputStream
public void write(byte[] b) throws java.io.IOException
write
in class java.io.FilterOutputStream
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
public void flush() throws java.io.IOException
flush
in class java.io.FilterOutputStream
public void flush(boolean endChunking) throws java.io.IOException
public void close() throws java.io.IOException
close
in class java.io.FilterOutputStream
java.io.IOException
- public void write(java.io.InputStream in, int len) throws java.io.IOException
public void println() throws java.io.IOException
public void println(java.lang.Object o) throws java.io.IOException
public void print(java.lang.Object o) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |