public class NullOutputStream extends OutputStream implements RepositionableStream
This stream discards whatever is written into it. Its usefulness is in
previewing the length of some coding by wrapping it in an OutputBitStream (it is a good idea, in this case, to specify a 0-length buffer).
This class is a singleton. You cannot create a null output stream,
but you can obtain an instance of this class using getInstance().
| Modifier and Type | Method and Description |
|---|---|
static NullOutputStream |
getInstance()
Returns the only instance of this class.
|
long |
position() |
void |
position(long newPosition) |
void |
write(int discarded) |
close, flush, write, writepublic void write(int discarded)
write in class OutputStreampublic static NullOutputStream getInstance()
public long position()
throws IOException
position in interface RepositionableStreamIOExceptionpublic void position(long newPosition)
throws IOException
position in interface RepositionableStreamIOException