Class NullOutputStream

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

    public class NullOutputStream
    extends java.io.OutputStream
    Never writes data. Calls never go beyond this class.

    This output stream has no destination and all bytes written to it are ignored.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(byte[] b)
      Does nothing.
      void write​(byte[] b, int off, int len)
      Does nothing.
      void write​(int b)
      Does nothing.
      • 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
    • Method Detail

      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Does nothing.
        Overrides:
        write in class java.io.OutputStream
        Parameters:
        b - The This method ignores this parameter.
        Throws:
        java.io.IOException - This method never throws any exceptions.
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Does nothing.
        Overrides:
        write in class java.io.OutputStream
        Parameters:
        b - This method ignores this parameter.
        off - This method ignores this parameter.
        len - This method ignores this parameter.
      • write

        public void write​(int b)
        Does nothing.
        Specified by:
        write in class java.io.OutputStream
        Parameters:
        b - This method ignores this parameter.