NullWriter

Returns a new {@code Writer} which discards all characters. The returned stream is initially open. The stream is closed by calling the {@code close()} method. Subsequent calls to {@code close()} have no effect.

<p> While the stream is open, the {@code append(char)}, {@code append(CharSequence)}, {@code append(CharSequence, int, int)}, {@code flush()}, {@code write(int)}, {@code write(char[])}, and {@code write(char[], int, int)} methods do nothing. After the stream has been closed, these methods all throw {@code IOException}.

<p> The {@link #lock object} used to synchronize operations on the returned {@code Writer} is not specified.

@return a {@code Writer} which discards all characters

Members

Functions

append
Writer append(char c)
Undocumented in source. Be warned that the author may not have intended to support it.
close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
flush
void flush()
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(int c)
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(byte[] cbuf, int off, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(string str)
Undocumented in source. Be warned that the author may not have intended to support it.
write
void write(string str, int off, int len)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From Writer

lock
Object lock;

The object used to synchronize operations on this stream. For efficiency, a character-stream object may use an object other than itself to protect critical sections. A subclass should therefore use the object in this field rather than {@code this} or a synchronized method.

write
void write(int c)

Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored.

write
void write(byte[] cbuf)

Writes an array of characters.

write
void write(byte[] cbuf, int off, int len)

Writes a portion of an array of characters.

write
void write(string str)

Writes a string.

write
void write(string str, int off, int len)

Writes a portion of a string.

append
Writer append(const(char)[] csq)

Appends the specified character sequence to this writer.

append
Writer append(const(char)[] csq, int start, int end)

Appends a subsequence of the specified character sequence to this writer. {@code Appendable}.

append
Writer append(char c)

Appends the specified character to this writer.

flush
void flush()

Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

close
void close()

Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.

Meta