This stream delays channel creation, so if a response will fit in the buffer it is not necessary to set the content length header.
| Modifier and Type | Field and Description |
|---|---|
| private ByteBuffer | |
| private StreamSinkChannel | |
| private final long | |
| private final HttpServerExchange | |
| private static final int | |
| private static final int | |
| private static final int | |
| private PooledByteBuffer | |
| private int | |
| private long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private ByteBuffer | |
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| public long | |
| private static boolean | |
| public void | resetBuffer()
If the response has not yet been written to the client this method will clear the streams buffer, invalidating any content that has already been written. |
| public void | |
| pack-priv void | |
| public void | write(final int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(final byte[]
the data. b)Overrides java. Writes |
| public void | write(final byte[]
the data. b, final int the start offset in the data. off, final int the number of bytes to write. len)Overrides java. Writes |
| public void | |
| public void | |
| private void |
| buffer | back to summary |
|---|---|
| private ByteBuffer buffer | |
| channel | back to summary |
|---|---|
| private StreamSinkChannel channel | |
| contentLength | back to summary |
|---|---|
| private final long contentLength | |
| exchange | back to summary |
|---|---|
| private final HttpServerExchange exchange | |
| FLAG_CLOSED | back to summary |
|---|---|
| private static final int FLAG_CLOSED | |
| FLAG_WRITE_STARTED | back to summary |
|---|---|
| private static final int FLAG_WRITE_STARTED | |
| MAX_BUFFERS_TO_ALLOCATE | back to summary |
|---|---|
| private static final int MAX_BUFFERS_TO_ALLOCATE | |
| pooledBuffer | back to summary |
|---|---|
| private PooledByteBuffer pooledBuffer | |
| state | back to summary |
|---|---|
| private int state | |
| written | back to summary |
|---|---|
| private long written | |
| UndertowOutputStream | back to summary |
|---|---|
| public UndertowOutputStream(HttpServerExchange exchange) Construct a new instance. No write timeout is configured.
| |
| buffer | back to summary |
|---|---|
| private ByteBuffer buffer() | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| getBytesWritten | back to summary |
|---|---|
| public long getBytesWritten() | |
| isHeadRequestWithContentLength | back to summary |
|---|---|
| private static boolean isHeadRequestWithContentLength(HttpServerExchange exchange) | |
| resetBuffer | back to summary |
|---|---|
| public void resetBuffer() If the response has not yet been written to the client this method will clear the streams buffer, invalidating any content that has already been written. If any content has already been sent to the client then this method will throw and IllegalStateException
| |
| transferFrom | back to summary |
|---|---|
| public void transferFrom(FileChannel source) throws IOException Implements io.
| |
| updateWritten | back to summary |
|---|---|
| pack-priv void updateWritten(final long len) throws IOException | |
| write | back to summary |
|---|---|
| public void write(final int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b) throws IOException Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b, final int off, final int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public void write(ByteBuffer[] buffers) throws IOException Implements io.
| |
| write | back to summary |
|---|---|
| public void write(ByteBuffer byteBuffer) throws IOException Implements io.
| |
| writeBufferBlocking | back to summary |
|---|---|
| private void writeBufferBlocking(final boolean writeFinal) throws IOException | |