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 NullOutputStream
NULL_OUTPUT_STREAM
A singleton.

Method Summary

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

Field Details

NULL_OUTPUT_STREAM

public static final NullOutputStream NULL_OUTPUT_STREAM
A singleton.

Method Details

write

public void write(byte[] b)
            throws IOException
Does nothing - output to /dev/null.
Parameters:
b - The bytes to write

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

Copyright (c) 2002-2009 Apache Software Foundation