commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita" <ki...@apache.org>
Subject Re: [IO] NullPrintStream
Date Fri, 24 May 2019 13:30:51 GMT
 Is it equivalent to JDK 11 Writer#nullWriter?

https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Writer.html#nullWriter()

If so I'm -0, not a blocker, but I have on a Python project for about 1 year, catching up
with the language and libraries, and lost track of JVM release dates, EOL. But I think Java
11 will be LTS, and maybe others will update to it quickly?


But if it's not doing the same as Writer#nullWriter, +0 (I don't have a use case for it, but
sounds OK/useful to others)


CheersBruno

    On Saturday, 25 May 2019, 12:49:45 am NZST, Gary Gregory <garydgregory@gmail.com>
wrote:  
 
 Hi All:

We have a handy NullOutputStream.

I'd like to add a convenience NullPrintStream, which would dead simple:

/**
 * This PrintStream writes all data to the famous <b>/dev/null</b>.
 * <p>
 * This print stream has no destination (file/socket etc.) and all bytes
written to it are ignored and lost.
 * </p>
 * @since 2.7
 */
public class NullPrintStream extends PrintStream {

    public static final NullPrintStream NULL_PRINT_STREAM = new
NullPrintStream();

    @SuppressWarnings("resource")
    public NullPrintStream() {
        super(new NullOutputStream());
    }

}

Any objections?

Gary
  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message