Class RandomAccessSink

  • All Implemented Interfaces:
    java.lang.AutoCloseable, Markup, org.apache.maven.doxia.sink.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
    Author:
    Robert Scholte
    See Also:
    BufferingSinkProxyFactory
    • Constructor Detail

      • RandomAccessSink

        public RandomAccessSink​(org.apache.maven.doxia.sink.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​(org.apache.maven.doxia.sink.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​(org.apache.maven.doxia.sink.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​(org.apache.maven.doxia.sink.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 org.apache.maven.doxia.sink.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 org.apache.maven.doxia.sink.Sink
        Overrides:
        close in class SinkWrapper
      • flush

        public void flush()
        Deprecated.
        Flush all sinks
        Specified by:
        flush in interface org.apache.maven.doxia.sink.Sink
        Overrides:
        flush in class SinkWrapper