Class NoCloseOutputStream

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

    public class NoCloseOutputStream
    extends java.io.OutputStream
    OutputStream with the close() disabled. We write multiple documents to a ZipOutputStream. Some of the formatters call a close() after writing their data. We don't want them to do that, so we wrap regular OutputStreams in this NoCloseOutputStream.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.OutputStream outputStream  
    • Constructor Summary

      Constructors 
      Constructor Description
      NoCloseOutputStream​(java.io.OutputStream outputStream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      A close() that does not call it's parent's close()
      void write​(int b)  
      • Methods inherited from class java.io.OutputStream

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

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

      • outputStream

        private java.io.OutputStream outputStream
    • Constructor Detail

      • NoCloseOutputStream

        public NoCloseOutputStream​(java.io.OutputStream 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
      • close

        public void close()
        A close() that does not call it's parent's close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream