package ws.prova.util;

/*
 * Copyright (C) 2002-2007 <a href="mailto:a.kozlenkov@city.ac.uk">Alex Kozlenkov</a>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;

/**
 * A <code>Writer</code> that is used for discarding the output from Prova
 * <p>Title: Prova </p>
 * <p>Description: A <code>Writer</code> that is used for discarding the output from Prova</p>
 * <p>Copyright: Copyright (C) 2002-2007</p>
 * <p>Company: City University, London, United Kingdom</p>
 *
 * @author Alban Peignier
 * @version 2.0 <25 March 2007>
 */

public final class NullWriter extends Writer {

	private static final Writer INSTANCE = new NullWriter();

	public static final Writer getInstance() {
		return INSTANCE;
	}

	private static final PrintWriter PRINTWRITER_INSTANCE = new PrintWriter(new NullWriter());

	public static final PrintWriter getPrintWriter() {
		return PRINTWRITER_INSTANCE;
	}

	private NullWriter() {

	}

	public void close() throws IOException {

	}

	public void flush() throws IOException {

	}

	public void write(char[] cbuf, int off, int len) throws IOException {

	}
}