Class RandomAccessSink

  • All Implemented Interfaces:
    java.lang.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:
    BufferingSinkProxyFactory
    • Field Detail

      • sinkFactory

        private SinkFactory sinkFactory
        Deprecated.
      • encoding

        private java.lang.String encoding
        Deprecated.
      • coreOutputStream

        private java.io.OutputStream coreOutputStream
        Deprecated.
      • coreSink

        private Sink coreSink
        Deprecated.
      • sinks

        private java.util.List<Sink> sinks
        Deprecated.
      • outputStreams

        private java.util.List<java.io.ByteArrayOutputStream> outputStreams
        Deprecated.
      • currentSink

        private Sink currentSink
        Deprecated.
    • Constructor Detail

      • RandomAccessSink

        public RandomAccessSink​(SinkFactory sinkFactory,
                                java.io.OutputStream stream)
                         throws java.io.IOException
        Deprecated.

        Constructor for RandomAccessSink.

        Parameters:
        sinkFactory - a SinkFactory object.
        stream - a OutputStream object.
        Throws:
        java.io.IOException - if any.
      • RandomAccessSink

        public RandomAccessSink​(SinkFactory sinkFactory,
                                java.io.OutputStream stream,
                                java.lang.String encoding)
                         throws java.io.IOException
        Deprecated.

        Constructor for RandomAccessSink.

        Parameters:
        sinkFactory - a SinkFactory object.
        stream - a OutputStream object.
        encoding - a String object.
        Throws:
        java.io.IOException - if any.
      • RandomAccessSink

        public RandomAccessSink​(SinkFactory sinkFactory,
                                java.io.File outputDirectory,
                                java.lang.String outputName)
                         throws java.io.IOException
        Deprecated.

        Constructor for RandomAccessSink.

        Parameters:
        sinkFactory - a SinkFactory object.
        outputDirectory - a File object.
        outputName - a String object.
        Throws:
        java.io.IOException - if any.
      • RandomAccessSink

        public RandomAccessSink​(SinkFactory sinkFactory,
                                java.io.File outputDirectory,
                                java.lang.String outputName,
                                java.lang.String encoding)
                         throws java.io.IOException
        Deprecated.

        Constructor for RandomAccessSink.

        Parameters:
        sinkFactory - a SinkFactory object.
        outputDirectory - a File object.
        outputName - a String object.
        encoding - a String object.
        Throws:
        java.io.IOException - if any.
    • Method Detail

      • 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 java.lang.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