Writer.NullWriter Method

Definition

Returns a new Writer which discards all characters.

[Android.Runtime.Register("nullWriter", "()Ljava/io/Writer;", "", ApiSince=33)]
public static Java.IO.Writer? NullWriter ();
[<Android.Runtime.Register("nullWriter", "()Ljava/io/Writer;", "", ApiSince=33)>]
static member NullWriter : unit -> Java.IO.Writer

Returns

a Writer which discards all characters

Attributes

Remarks

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

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

The #lock object used to synchronize operations on the returned Writer is not specified.

Added in 11.

Java documentation for java.io.Writer.nullWriter().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to