All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.io.stream.MultiWriter Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
package panda.io.stream;

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

public class MultiWriter extends Writer {
	private Writer[] outs;
	
	/**
	 * Constructs a new NullWriter.
	 * @param outs the output writer array
	 */
	public MultiWriter(Writer... outs) {
		this.outs = outs;
	}

	@Override
	public void write(final char[] chr, final int st, final int end) throws IOException {
		for (Writer o : outs) {
			o.write(chr, st, end);
		}
	}

	@Override
	public void flush() throws IOException {
		for (Writer o : outs) {
			o.flush();
		}
	}

	@Override
	public void close() throws IOException {
		for (Writer o : outs) {
			o.close();
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy