Class LineBreakingOutputStream

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

    public class LineBreakingOutputStream
    extends java.io.OutputStream
    Wrap OutputStream and insert line breaks while writing. Does not close the wrapped OutputStream.
    • Constructor Summary

      Constructors 
      Constructor Description
      LineBreakingOutputStream​(java.io.OutputStream toWrap)
      Wrap OutputStream and insert line breaks every 80 characters.
      LineBreakingOutputStream​(java.io.OutputStream toWrap, int maxWidth, java.lang.String lineSeparator)
      Wrap OutputStream and insert lineSeparator every maxWidth characters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()  
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

        close, nullOutputStream, write, write
      • Methods inherited from class java.lang.Object

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

      • LineBreakingOutputStream

        public LineBreakingOutputStream​(java.io.OutputStream toWrap)
        Wrap OutputStream and insert line breaks every 80 characters. Does not close the wrapped OutputStream.
      • LineBreakingOutputStream

        public LineBreakingOutputStream​(java.io.OutputStream toWrap,
                                        int maxWidth,
                                        java.lang.String lineSeparator)
        Wrap OutputStream and insert lineSeparator every maxWidth characters. Does not close the wrapped OutputStream.
    • Method Detail

      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.OutputStream
        Throws:
        java.io.IOException