org.apache.commons.io.output

Class NullOutputStream

public class NullOutputStream extends OutputStream

This OutputStream writes all data to the famous /dev/null.

This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.

Version: $Id: NullOutputStream.java 610010 2008-01-08 14:50:59Z niallp $

Author: Jeremias Maerki

Field Summary
static NullOutputStreamNULL_OUTPUT_STREAM
A singleton.
Method Summary
voidwrite(byte[] b, int off, int len)
Does nothing - output to /dev/null.
voidwrite(int b)
Does nothing - output to /dev/null.
voidwrite(byte[] b)
Does nothing - output to /dev/null.

Field Detail

NULL_OUTPUT_STREAM

public static final NullOutputStream NULL_OUTPUT_STREAM
A singleton.

Method Detail

write

public void write(byte[] b, int off, int len)
Does nothing - output to /dev/null.

Parameters: b The bytes to write off The start offset len The number of bytes to write

write

public void write(int b)
Does nothing - output to /dev/null.

Parameters: b The byte to write

write

public void write(byte[] b)
Does nothing - output to /dev/null.

Parameters: b The bytes to write

Throws: IOException never

Copyright (c) 2002-2011 Apache Software Foundation