Gary Gregory created IO-608:
-------------------------------

             Summary: Add a convenience NullPrintStream
                 Key: IO-608
                 URL: https://issues.apache.org/jira/browse/IO-608
             Project: Commons IO
          Issue Type: New Feature
          Components: Streams/Writers
            Reporter: Gary Gregory
            Assignee: Gary Gregory
             Fix For: 2.7


We have a handy {{NullOutputStream}}.
 
I'd like to add a convenience {{NullPrintStream}}, which would dead simple:
 
{code:java} 
/**
 * 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());
    }

}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to