Package org.apache.tika.io
Class NullOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.tika.io.NullOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class NullOutputStream extends OutputStream
This OutputStream writes all data to the famous /dev/null.This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
- Since:
- Apache Tika 0.4, copied from Commons IO 1.4
- Author:
- Jeremias Maerki
-
-
Field Summary
Fields Modifier and Type Field Description static NullOutputStream
NULL_OUTPUT_STREAM
A singleton.
-
Constructor Summary
Constructors Constructor Description NullOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(byte[] b)
Does nothing - output to/dev/null
.void
write(byte[] b, int off, int len)
Does nothing - output to/dev/null
.void
write(int b)
Does nothing - output to/dev/null
.-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream
-
-
-
-
Field Detail
-
NULL_OUTPUT_STREAM
public static final NullOutputStream NULL_OUTPUT_STREAM
A singleton.
-
-
Method Detail
-
write
public void write(byte[] b, int off, int len)
Does nothing - output to/dev/null
.- Overrides:
write
in classOutputStream
- Parameters:
b
- The bytes to writeoff
- The start offsetlen
- The number of bytes to write
-
write
public void write(int b)
Does nothing - output to/dev/null
.- Specified by:
write
in classOutputStream
- Parameters:
b
- The byte to write
-
write
public void write(byte[] b) throws IOException
Does nothing - output to/dev/null
.- Overrides:
write
in classOutputStream
- Parameters:
b
- The bytes to write- Throws:
IOException
- never
-
-