Interface JsonOutput

All Superinterfaces:
AutoCloseable, Closeable

public interface JsonOutput extends Closeable
Output that can be aware of server content chunking.

We can use an implementation of JsonOutput such that it can make use of the underlying buffer used by avaje-jsonb, using writeLast(byte[], int, int) to know if the content is complete (and typically can be written directly as fixed content) or if the content is still being written (and potentially written by an http server as chunked content).

Typically, for HTTP servers that can send output using fixed length or chunked.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Flush the underlying OutputStream.
    static JsonOutput
    of(OutputStream outputStream)
    Deprecated.
    static JsonOutput
    ofStream(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.

    Methods inherited from interface java.io.Closeable

    close