FileDocCategorySizeDatePackage
ClosedOutputStream.javaAPI DocAndroid 1.5 API1859Wed May 06 22:42:46 BST 2009org.apache.commons.io.output

ClosedOutputStream

public class ClosedOutputStream extends OutputStream
Closed output stream. This stream throws an exception on all attempts to write something to the stream.

Typically uses of this class include testing for corner cases in methods that accept an output stream and acting as a sentinel value instead of a null output stream.

version
$Id: ClosedOutputStream.java 601751 2007-12-06 14:55:45Z niallp $
since
Commons IO 1.4

Fields Summary
public static final ClosedOutputStream
CLOSED_OUTPUT_STREAM
A singleton.
Constructors Summary
Methods Summary
public voidwrite(int b)
Throws an {@link IOException} to indicate that the stream is closed.

param
b ignored
throws
IOException always thrown


                           
          
        throw new IOException("write(" + b + ") failed: stream is closed");