Class RandomAccessSink

All Implemented Interfaces:
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:
  • Constructor Details

    • RandomAccessSink

      public RandomAccessSink(org.apache.maven.doxia.sink.SinkFactory sinkFactory, OutputStream stream) throws IOException
      Deprecated.

      Constructor for RandomAccessSink.

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

      public RandomAccessSink(org.apache.maven.doxia.sink.SinkFactory sinkFactory, OutputStream stream, String encoding) throws IOException
      Deprecated.

      Constructor for RandomAccessSink.

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

      public RandomAccessSink(org.apache.maven.doxia.sink.SinkFactory sinkFactory, File outputDirectory, String outputName) throws IOException
      Deprecated.

      Constructor for RandomAccessSink.

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

      public RandomAccessSink(org.apache.maven.doxia.sink.SinkFactory sinkFactory, File outputDirectory, String outputName, String encoding) throws IOException
      Deprecated.

      Constructor for RandomAccessSink.

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

    • 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 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