Class FormattedOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class FormattedOutputStream
    extends java.io.FilterOutputStream
    Deprecated.
    FormattedOutputStream buffers the output data and then outputs each line after reformatting the line using the specified Reformatter. Context Data can be set via setContext(String, String).
    • Field Summary

      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      FormattedOutputStream​(Reformatter reformatter, java.io.OutputStream sink)
      Deprecated.
      Create a new FormattedOutputStream
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void close()
      Deprecated.
       
      java.util.Map<java.lang.String,​java.lang.String> getContext()
      Deprecated.
       
      java.io.OutputStream getOriginalSink()
      Deprecated.
      Return original OutputStream sink
      void setContext​(java.lang.String key, java.lang.String value)
      Deprecated.
      Set a context data value to be used by the Reformatter
      void write​(int b)
      Deprecated.
      Overrides the FilterOutputStream method to buffer the data.
      • Methods inherited from class java.io.FilterOutputStream

        flush, write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FormattedOutputStream

        public FormattedOutputStream​(Reformatter reformatter,
                                     java.io.OutputStream sink)
        Deprecated.
        Create a new FormattedOutputStream
        Parameters:
        reformatter - reformatter or null
        sink - destination OutputStream
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Deprecated.
        Overrides the FilterOutputStream method to buffer the data. When a newline is encountered the buffered data is reformatted and written to the underlying output stream.
        Overrides:
        write in class java.io.FilterOutputStream
        Parameters:
        b - char
        Throws:
        java.io.IOException - on io error
      • close

        public void close()
                   throws java.io.IOException
        Deprecated.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.IOException
      • getContext

        public java.util.Map<java.lang.String,​java.lang.String> getContext()
        Deprecated.
        Returns:
        the context map
      • setContext

        public void setContext​(java.lang.String key,
                               java.lang.String value)
        Deprecated.
        Set a context data value to be used by the Reformatter
        Parameters:
        key - data key
        value - data value
      • getOriginalSink

        public java.io.OutputStream getOriginalSink()
        Deprecated.
        Return original OutputStream sink
        Returns:
        original sink