org.apache.commons.io.output
Class NullWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.apache.commons.io.output.NullWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class NullWriter
extends java.io.Writer

This Writer writes all data to the famous /dev/null.

This Writer has no destination (file/socket etc.) and all characters written to it are ignored and lost.

Version:
$Id: NullWriter.java 462832 2006-10-11 15:48:09Z scolebourne $

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
NullWriter()
          Constructs a new NullWriter.
 
Method Summary
 void close()
           
 void flush()
           
 void write(char[] chr)
           
 void write(char[] chr, int st, int end)
           
 void write(int idx)
           
 void write(java.lang.String str)
           
 void write(java.lang.String str, int st, int end)
           
 
Methods inherited from class java.io.Writer
append, append, append
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullWriter

public NullWriter()
Constructs a new NullWriter.

Method Detail

write

public void write(int idx)
Overrides:
write in class java.io.Writer
See Also:
Writer.write(int)

write

public void write(char[] chr)
Overrides:
write in class java.io.Writer
See Also:
Writer.write(char[])

write

public void write(char[] chr,
                  int st,
                  int end)
Specified by:
write in class java.io.Writer
See Also:
Writer.write(char[], int, int)

write

public void write(java.lang.String str)
Overrides:
write in class java.io.Writer
See Also:
Writer.write(String)

write

public void write(java.lang.String str,
                  int st,
                  int end)
Overrides:
write in class java.io.Writer
See Also:
Writer.write(String, int, int)

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
See Also:
Writer.flush()

close

public void close()
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
See Also:
Writer.close()


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.