BufferWritableOutputStream, java.io.Closeable, java.io.Flushable, java.lang.AutoCloseablepublic class UndertowOutputStream extends java.io.OutputStream implements BufferWritableOutputStream
This stream delays channel creation, so if a response will fit in the buffer it is not necessary to set the content length header.
| Constructor | Description |
|---|---|
UndertowOutputStream(HttpServerExchange exchange) |
Construct a new instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
flush() |
|
long |
getBytesWritten() |
|
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.
|
void |
transferFrom(java.nio.channels.FileChannel source) |
|
void |
write(byte[] b) |
|
void |
write(byte[] b,
int off,
int len) |
|
void |
write(int b) |
|
void |
write(java.nio.ByteBuffer byteBuffer) |
|
void |
write(java.nio.ByteBuffer[] buffers) |
public UndertowOutputStream(HttpServerExchange exchange)
exchange - The exchangepublic void resetBuffer()
java.lang.IllegalStateException - If the response has been commitedpublic long getBytesWritten()
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(java.nio.ByteBuffer[] buffers)
throws java.io.IOException
write in interface BufferWritableOutputStreamjava.io.IOExceptionpublic void write(java.nio.ByteBuffer byteBuffer)
throws java.io.IOException
write in interface BufferWritableOutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void transferFrom(java.nio.channels.FileChannel source)
throws java.io.IOException
transferFrom in interface BufferWritableOutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2018. All rights reserved.