|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
org.apache.tapestry.request.ResponseOutputStream
public class ResponseOutputStream
A special output stream works with a HttpServletResponse, buffering
data so as to defer opening the response's output stream.
The buffering is pretty simple because the code
between IMarkupWriter and this shows lots of buffering
after the PrintWriter and inside the OutputStreamWriter that
can't be configured.
This class performs some buffering, but it is not all that
useful because the
Body component (which will
be used on virtually all Tapestry pages), buffers its wrapped contents
(that is, evertyhing inside the <body> tag in the generated HTML).
| Field Summary | |
|---|---|
static int |
DEFAULT_SIZE
Default size for the buffer (2000 bytes). |
| Constructor Summary | |
|---|---|
ResponseOutputStream(HttpServletResponse response)
Creates the stream with the default maximum buffer size. |
|
ResponseOutputStream(HttpServletResponse response,
int maxSize)
Standard constructor. |
|
| Method Summary | |
|---|---|
void |
close()
Does nothing. |
void |
flush()
Flushes the underlying output stream, if is has been opened. |
void |
forceFlush()
Writes the internal buffer to the output stream, opening it if necessary, then flushes the output stream. |
String |
getContentType()
|
boolean |
getDiscard()
|
void |
reset()
Discards all output in the buffer. |
void |
setBufferSize(int value)
Changes the maximum buffer size. |
void |
setContentType(String value)
|
void |
setDiscard(boolean value)
Indicates whether the stream should ignore all data written to it. |
void |
write(byte[] b,
int off,
int len)
|
void |
write(int b)
|
| Methods inherited from class java.io.OutputStream |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_SIZE
| Constructor Detail |
|---|
public ResponseOutputStream(HttpServletResponse response)
public ResponseOutputStream(HttpServletResponse response,
int maxSize)
| Method Detail |
|---|
public void close()
throws IOException
close() from
IMarkupWriter.close() ... see flush().
close in interface Closeableclose in class OutputStreamIOException
public void flush()
throws IOException
This method explicitly does not flush the internal buffer ...
that's because when an IMarkupWriter is closed (for instance, because
an exception is thrown), that close() spawns flush()es
and close()s throughout the output stream chain, eventually
reaching this method.
flush in interface Flushableflush in class OutputStreamIOExceptionforceFlush()
public void forceFlush()
throws IOException
IOExceptionpublic String getContentType()
public boolean getDiscard()
public void reset()
throws IOException
Clears the discard flag.
IOException
public void setBufferSize(int value)
throws IOException
IOExceptionpublic void setContentType(String value)
public void setDiscard(boolean value)
public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOException
public void write(int b)
throws IOException
write in class OutputStreamIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||