HttpOutput implements ServletOutputStream
as required by the Servlet specification.
HttpOutput buffers content written by the application until a
further write will overflow the buffer, at which point it triggers a commit
of the response.
HttpOutput can be closed and reopened, to allow requests included
via RequestDispatcher#include(ServletRequest, ServletResponse) to
close the stream, to be reopened after the inclusion ends.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | HttpOutput.
The API State which combines with the output State:
OPEN/BLOCKING---last----------------------------+ CLOSED/BLOCKING
/ | ^ \ ^ ^
/ w | \ / |
/ | owc +--owcL------------------->--owcL-----\---------------------+ |
| v | / / V |
swl OPEN/BLOCKED----last---->CLOSE/BLOCKED----owc----->CLOSING/BLOCKED--owcL------+
|
\
\
V
+-->OPEN/READY------last---------------------------+
/ ^ | \
/ / w \
| / | +--owcL------------------->--owcL----\---------------------------+
| / v / / V |
| irt OPEN/PENDING----last---->CLOSE/PENDING----owc---->CLOSING/PENDING--owcL----+ |
| \ / | | ^ | | |
owc \/ owc irf / irf | |
| /\ | | / | | |
| / \ V | / | V V
| irf OPEN/ASYNC------last----------|----------------+ | CLOSED/ASYNC
| \ | | ^ ^
\ \ | | | |
\ \ | | | |
\ v v v | |
+--OPEN/UNREADY----last---->CLOSE/UNREADY----owc----->CLOSING/UNREADY--owcL---+ |
\ \ |
+--owcL------------------->--owcL--------------------------------+
swl : setWriteListener
w : write
owc : onWriteComplete last == false
owcL : onWriteComplete last == true
irf : isReady() == false
irt : isReady() == true
last : close() or complete(Callback) or write of known last content
|
| private class | |
| private class | |
| private abstract class | |
| private class | |
| private class | HttpOutput.
An iterating callback that will take content from an InputStream and write it to this HttpOutput. |
| private abstract class | |
| private class | HttpOutput.
An iterating callback that will take content from a ReadableByteChannel and write it to this HttpOutput. |
| pack-priv static enum | HttpOutput.
The output state |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private RetainableByteBuffer | |
| private HttpOutput. | |
| private int | |
| private final ServletChannelState | |
| private Callback | |
| private int | |
| private static final ThreadLocal | |
| private long | |
| private long | |
| private volatile Throwable | |
| private final ServletChannel | |
| private boolean | |
| private HttpOutput. | |
| private final Blocker. | |
| private WriteListener | |
| private long | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private RetainableByteBuffer | |
| private void | |
| private void | |
| private void | |
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| public void | |
| public void | |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| public int | |
| public ByteBuffer | |
| public long | |
| public boolean | |
| public boolean | |
| public boolean | isReady()
Implements abstract jakarta. Returns true if data can be written without blocking else returns false. |
| public boolean | isWritten()
Returns: True if any content has been written via the |
| private int | |
| public void | onFlushed(long
the number of bytes flushed bytes)Invoked when bytes have been flushed to the network. |
| private void | |
| private boolean | |
| public void | print(String
the s)String to send to the clientOverrides jakarta. Writes a |
| private void | |
| public void | println(String
the s)String to write to the clientOverrides jakarta. Writes a |
| public void | |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | sendContent(ByteBuffer
The whole content to send content, final Callback The callback to use to notify success or failure callback)Asynchronous send of whole content. |
| public void | sendContent(InputStream
The stream content to send in, Callback The callback to use to notify success or failure callback)Asynchronous send of stream content. |
| public void | sendContent(ReadableByteChannel
The channel content to send in, Callback The callback to use to notify success or failure callback)Asynchronous send of channel content. |
| public void | |
| public void | setWriteListener(WriteListener
the writeListener)WriteListener that should be notified when it's possible to writeImplements abstract jakarta. Instructs the |
| public void | |
| private String | |
| public String | |
| private boolean | |
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. Writes |
| public void | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |