Class JacksonStreamSink

  • All Implemented Interfaces:
    Sink, Closeable, AutoCloseable

    @ProviderType
    public final class JacksonStreamSink
    extends Object
    implements Sink
    Writes the JSON stream elements into an output stream.
    • Constructor Detail

      • JacksonStreamSink

        public JacksonStreamSink​(OutputStream output)
                          throws IOException
        Parameters:
        output - The output stream to write into
        Throws:
        IOException - Error on writing
    • Method Detail

      • write

        public void write​(JsonElement jsonElement)
                   throws IOException
        Description copied from interface: Sink
        Takes an JSON element and writes it some where in any format.
        Specified by:
        write in interface Sink
        Parameters:
        jsonElement - JSON element
        Throws:
        IOException - Writing error
      • hasOutput

        public boolean hasOutput()
        Specified by:
        hasOutput in interface Sink
        Returns:
        True if any output was written