BufferWritableOutputStream
, java.io.Closeable
, java.io.Flushable
, java.lang.AutoCloseable
public 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.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(java.nio.ByteBuffer[] buffers) throws java.io.IOException
write
in interface BufferWritableOutputStream
java.io.IOException
public void write(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
write
in interface BufferWritableOutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public void transferFrom(java.nio.channels.FileChannel source) throws java.io.IOException
transferFrom
in interface BufferWritableOutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
Copyright © 2018. All rights reserved.