Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

import java.io.OutputStream;
import java.io.PrintStream;

public class Main {
    /**
     * Creates a no-op print stream.
     */
    public static PrintStream nopPrintStream() {
        return new PrintStream(nopOuputStream());
    }

    /**
     * Creates a no-op outputStream.
     */
    public static OutputStream nopOuputStream() {
        return new OutputStream() {

            @Override
            public void write(int paramInt) throws IOException {
                // Do nothing
            }
        };
    }
}