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.ApiState
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.InputStreamWritingCB
An iterating callback that will take content from an InputStream and write it to this HttpOutput. |
| private abstract class | |
| private class | HttpOutput.ReadableByteChannelWritingCB
An iterating callback that will take content from a ReadableByteChannel and write it to this HttpOutput. |
| pack-priv static enum | HttpOutput.State
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. |
| public void | |
| public void | |
| public void | flush()
Overrides java. Implements java. |
| public int | |
| public ByteBuffer | |
| public long | Returns: The bytes written via thejakarta. API. This
may differ from the bytes reported by org.
due to buffering, compression, other interception or writes that bypass the servlet API.
|
| public boolean | |
| public boolean | |
| public boolean | isReady()
Implements abstract jakarta. |
| public boolean | Returns: True if any content has been written via thejakarta. API.
|
| 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. String to the client, without a carriage return-line feed (CRLF) character at the end.
|
| private void | |
| public void | println(String
the s)String to write to the clientOverrides jakarta. String to the client, followed by a carriage return-line feed (CRLF).
|
| 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. ServletOutputStream to invoke the provided WriteListener when it is possible to
write
|
| 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. len bytes from the specified byte array
starting at offset off to this output stream.
|
| public void | |
| public void | write(int
the b)byte.Implements abstract java. |