- All Superinterfaces:
AutoCloseable
,Closeable
Output that can be aware of server content chunking.
Typically, for HTTP servers that can send output using fixed length or chunked.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
Flush the underlying OutputStream.static JsonOutput
of
(io.helidon.webserver.http.ServerResponse nimaServerResponse) Create for Nima ServerResponse.static JsonOutput
of
(OutputStream outputStream) Create as a simple wrapper for OutputStream.Return the underlying OutputStream.void
write
(byte[] content, int offset, int length) Write the content to the underlying output stream.default void
writeLast
(byte[] content, int offset, int length) Write the last content to the underlying output stream.
-
Method Details
-
of
Create as a simple wrapper for OutputStream. -
of
Create for Nima ServerResponse. -
write
Write the content to the underlying output stream.- Throws:
IOException
-
writeLast
Write the last content to the underlying output stream.Given that this is known to be the last content written an implementation can make use of this to optimise for sending as fixed length content.
- Throws:
IOException
-
flush
Flush the underlying OutputStream.- Throws:
IOException
-
unwrapOutputStream
OutputStream unwrapOutputStream()Return the underlying OutputStream.This is used for Jsonb adapters (Jackson) that can't support writeLast() semantics.
-