Class NullOutputStream

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

    public final class NullOutputStream
    extends java.io.OutputStream
    An OutputStream that simply discards all data written to it.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(byte[] b)
      Discard the data.
      void write​(byte[] b, int off, int len)
      Discard the data.
      void write​(int b)
      Discard the data.
      • Methods inherited from class java.io.OutputStream

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

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

      • NullOutputStream

        public NullOutputStream()
    • Method Detail

      • write

        public void write​(int b)
        Discard the data.
        Specified by:
        write in class java.io.OutputStream
        See Also:
        OutputStream.write(int)
      • write

        public void write​(byte[] b)
        Discard the data.
        Overrides:
        write in class java.io.OutputStream
        See Also:
        OutputStream.write(int)
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Discard the data.
        Overrides:
        write in class java.io.OutputStream
        See Also:
        OutputStream.write(int)