org.apache.commons.io.output
Class ClosedOutputStream
java.lang.Object
  
java.io.OutputStream
      
org.apache.commons.io.output.ClosedOutputStream
- All Implemented Interfaces: 
 - Closeable, Flushable
 
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.
- Since:
 
  - Commons IO 1.4
 
- Version:
 
  - $Id: ClosedOutputStream.java 659817 2008-05-24 13:23:10Z niallp $
 
 
 
| 
Method Summary | 
 void | 
write(int b)
 
          Throws an IOException to indicate that the stream is closed. | 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
CLOSED_OUTPUT_STREAM
public static final ClosedOutputStream CLOSED_OUTPUT_STREAM
- A singleton.
 
ClosedOutputStream
public ClosedOutputStream()
write
public void write(int b)
           throws IOException
- Throws an 
IOException to indicate that the stream is closed.
- Specified by:
 write in class OutputStream
 
- Parameters:
 b - ignored
- Throws:
 IOException - always thrown
 
 
Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.