|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.openqa.jetty.http.HttpOutputStream
public class 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 Class[] |
__filterArg
|
Fields inherited from interface org.openqa.jetty.util.OutputObserver |
---|
__CLOSED, __CLOSING, __COMMITING, __FIRST_WRITE, __RESET_BUFFER |
Constructor Summary | |
---|---|
HttpOutputStream(OutputStream outputStream)
Constructor. |
|
HttpOutputStream(OutputStream outputStream,
int bufferSize)
Constructor. |
|
HttpOutputStream(OutputStream outputStream,
int bufferSize,
int headerReserve)
Constructor. |
Method Summary | |
---|---|
void |
addObserver(OutputObserver observer)
Add an Output Observer. |
void |
addObserver(OutputObserver observer,
Object data)
Add an Output Observer. |
protected void |
checkOutput()
|
void |
close()
Close the stream. |
void |
destroy()
|
void |
flush()
|
OutputStream |
getBufferedOutputStream()
Get the buffered output stream. |
int |
getBufferSize()
Get the output buffer capacity. |
int |
getBytesWritten()
|
OutputStream |
getOutputStream()
Get the backing output stream. |
Writer |
getWriter(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(OutputStream out,
int action,
Object ignoredData)
Output Notification. |
protected int |
prepareOutput(int length)
|
void |
resetBuffer()
Reset Buffered output. |
void |
resetObservers()
Reset the observers. |
void |
resetStream()
Reset the stream. |
void |
setBufferedOutputStream(BufferedOutputStream bos)
|
void |
setBufferSize(int size)
Set the output buffer size. |
void |
setChunking()
Set chunking mode. |
void |
setContentLength(int length)
|
String |
toString()
|
void |
write(byte[] b)
|
void |
write(byte[] b,
int off,
int len)
|
void |
write(InputStream in,
int len)
|
void |
write(int b)
|
void |
writeHeader(HttpMessage httpMessage)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Class[] __filterArg
Constructor Detail |
---|
public HttpOutputStream(OutputStream outputStream)
outputStream
- The outputStream to buffer or chunk to.public HttpOutputStream(OutputStream outputStream, int bufferSize)
outputStream
- The outputStream to buffer or chunk to.public HttpOutputStream(OutputStream outputStream, int bufferSize, int headerReserve)
outputStream
- The outputStream to buffer or chunk to.Method Detail |
---|
public void setContentLength(int length)
public void setBufferedOutputStream(BufferedOutputStream bos)
public OutputStream getOutputStream()
public OutputStream getBufferedOutputStream()
public boolean isWritten()
public int getBufferSize()
public void setBufferSize(int size) throws IllegalStateException
size
- Minimum buffer size in bytes
IllegalStateException
- If output has been written.public int getBytesWritten()
public void resetBuffer() throws IllegalStateException
IllegalStateException
public void addObserver(OutputObserver observer)
observer
- The observer.public void addObserver(OutputObserver observer, Object data)
observer
- The observer.data
- Data to be passed wit notify calls.public void resetObservers()
public void nullOutput() throws IOException
IOException
public boolean isNullOutput() throws IOException
IOException
public void setChunking()
public boolean isChunking()
public void resetStream() throws IOException, IllegalStateException
IllegalStateException
- The stream cannot be
reset if chunking is enabled.
IOException
public void destroy()
public void writeHeader(HttpMessage httpMessage) throws IOException
writeHeader
in interface HttpMessage.HeaderWriter
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
protected void checkOutput()
protected int prepareOutput(int length) throws IOException
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public boolean isClosed() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
public void outputNotify(OutputStream out, int action, Object ignoredData) throws IOException
outputNotify
in interface OutputObserver
out
- The OutputStream that caused the eventaction
- The action takenignoredData
- Data associated with the event.
IOException
public void write(InputStream in, int len) throws IOException
IOException
public Writer getWriter(String encoding) throws IOException
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |