Class NullPrintStream

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

    public class NullPrintStream
    extends java.io.PrintStream
    Writes all data to the famous /dev/null.

    This print stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.

    Since:
    2.7
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static NullPrintStream NULL_PRINT_STREAM
      The singleton instance.
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      NullPrintStream()
      Constructs an instance.
    • Method Summary

      • Methods inherited from class java.io.PrintStream

        append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write
      • Methods inherited from class java.io.FilterOutputStream

        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
    • Field Detail

      • NULL_PRINT_STREAM

        public static final NullPrintStream NULL_PRINT_STREAM
        The singleton instance.
    • Constructor Detail

      • NullPrintStream

        public NullPrintStream()
        Constructs an instance.