Mp3dings 
20100427

de.mospace.lang
Class NullStream

java.lang.Object
  extended by java.io.OutputStream
      extended by de.mospace.lang.NullStream
All Implemented Interfaces:
Closeable, Flushable

public final class NullStream
extends OutputStream

A Singleton OutputStream that serves as a '/dev/null'-like data sink.


Method Summary
 Object clone()
          Throws a CloneNotSupportedException.
static OutputStream getInstance()
          Returns the sole instance of this class.
 void write(byte[] b)
          Does nothing.
 void write(byte[] b, int off, int len)
          Does nothing.
 void write(int b)
          Does nothing.
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static OutputStream getInstance()
Returns the sole instance of this class.

Returns:
an output stream whose write methods do nothing.

clone

public Object clone()
             throws CloneNotSupportedException
Throws a CloneNotSupportedException. This is a Singleton, therefore clone is not supported.

Overrides:
clone in class Object
Throws:
CloneNotSupportedException - This method always throws a CloneNotSupportedException.

write

public void write(int b)
           throws IOException
Does nothing.

Specified by:
write in class OutputStream
Throws:
IOException - This method will not throw an Exception.

write

public void write(byte[] b)
           throws IOException
Does nothing.

Overrides:
write in class OutputStream
Throws:
IOException - This method will not throw an Exception.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Does nothing.

Overrides:
write in class OutputStream
Throws:
IOException - This method will not throw an Exception.

Mp3dings 
20100427