org.apache.commons.io.output

Class 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

Field Summary

static ClosedOutputStream
CLOSED_OUTPUT_STREAM
A singleton.

Method Summary

void
write(int b)
Throws an IOException to indicate that the stream is closed.

Field Details

CLOSED_OUTPUT_STREAM

public static final ClosedOutputStream CLOSED_OUTPUT_STREAM
A singleton.

Method Details

write

public void write(int b)
            throws IOException
Throws an IOException to indicate that the stream is closed.
Parameters:
b - ignored

Copyright (c) 2002-2009 Apache Software Foundation