Udostępnij za pośrednictwem


OutputStream.NullOutputStream Method

Definition

Returns a new OutputStream which discards all bytes.

[Android.Runtime.Register("nullOutputStream", "()Ljava/io/OutputStream;", "", ApiSince=33)]
public static System.IO.Stream? NullOutputStream ();
[<Android.Runtime.Register("nullOutputStream", "()Ljava/io/OutputStream;", "", ApiSince=33)>]
static member NullOutputStream : unit -> System.IO.Stream

Returns

an OutputStream which discards all bytes

Attributes

Remarks

Returns a new OutputStream which discards all bytes. 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 write(int), write(byte[]), and write(byte[], int, int) methods do nothing. After the stream has been closed, these methods all throw IOException.

The flush() method does nothing.

Added in 11.

Java documentation for java.io.OutputStream.nullOutputStream().

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