Interface Streamable


  • public interface Streamable
    Represents some data that may be streamed out to a writer. Allows components in the rendering pipeline to generate their output lazily and directly to the final output buffer instead of passing a lot of temporary intermediate strings.

    Error Handling: Note that streamables are responsible for their own error handling. If your streamable throws an exception, chances are the error will propagate and kill the whole thing being rendered, so exceptions should be reserved for real infrastructure or programming errors. Errors in parsing or processing that are encountered during rendering should be handled inside the streamable itself (such as writing some kind of error to the output stream)

    • Method Detail

      • writeTo

        void writeTo​(Writer writer)
              throws IOException
        Write the contents of the streamable to the provided writer.
        Parameters:
        writer - the writer the streamable will be providing its output to
        Throws:
        IOException - if some error occurs while writing to the provided writer