Class NullOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class NullOutputStream
    extends OutputStream
    A "dev/null" output stream - an output stream implementation that discards all the data written to it. This implementation is not thread-safe. Note that once a null output stream instance is closed, any subsequent attempts to write the data to the closed stream result in an IOException being thrown.
    Author:
    Miroslav Fuksa, Marek Potociar