Class RandomAccessSink

All Implemented Interfaces:
AutoCloseable, Markup, Sink

@Deprecated public class RandomAccessSink extends SinkWrapper
Deprecated.
Use BufferingSinkProxyFactory instead which buffers on the (higher) Sink API level which usually is less memory intense than buffering the output stream which is done by this class. Also it doesn't require dynamically creating new sinks leveraging a SinkFactory.
The RandomAccessSink provides the ability to create a Sink with hooks. A page can be prepared by first creating its structure and specifying the positions of these hooks. After specifying the structure, the page can be filled with content from one or more models. These hooks can prevent you to have to loop over the model multiple times to build the page as desired.
Since:
1.3
See Also:
  • Field Details

    • sinkFactory

      private SinkFactory sinkFactory
      Deprecated.
    • encoding

      private String encoding
      Deprecated.
    • coreOutputStream

      private OutputStream coreOutputStream
      Deprecated.
    • coreSink

      private Sink coreSink
      Deprecated.
    • sinks

      private List<Sink> sinks
      Deprecated.
    • outputStreams

      private List<ByteArrayOutputStream> outputStreams
      Deprecated.
    • currentSink

      private Sink currentSink
      Deprecated.
  • Constructor Details

  • Method Details

    • addSinkHook

      public Sink addSinkHook()
      Deprecated.
      By calling this method a sink reference is added at the current position. You can write to both the new sink reference and the original sink. After flushing all sinks will be flushed in the right order.
      Returns:
      a subsink reference you can write to
    • close

      public void close()
      Deprecated.
      Close all sinks
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Sink
      Overrides:
      close in class SinkWrapper
    • flush

      public void flush()
      Deprecated.
      Flush all sinks
      Specified by:
      flush in interface Sink
      Overrides:
      flush in class SinkWrapper