Java.IO.OutputStream Class
A writable sink for bytes.

See Also: OutputStream Members


[Android.Runtime.Register("java/io/OutputStream", DoNotGenerateAcw=true)]
public abstract class OutputStream : Java.Lang.Object, ICloseable, IFlushable, IDisposable


A writable sink for bytes.

Most clients will use output streams that write data to the file system (Java.IO.FileOutputStream), the network (Java.Net.Socket.OutputStream/Java.Net.URLConnection.OutputStream), or to an in-memory byte array (Java.IO.ByteArrayOutputStream).

Use Java.IO.OutputStreamWriter to adapt a byte stream like this one into a character stream.

Most clients should wrap their output stream with Java.IO.BufferedOutputStream. Callers that do only bulk writes may omit buffering.

Subclassing OutputStream

Subclasses that decorate another output stream should consider subclassing Java.IO.FilterOutputStream, which delegates all calls to the target output stream.

All output stream subclasses should override bothOutputStream.Write(int) and OutputStream.Write(Byte[], System.Int32, System.Int32). The three argument overload is necessary for bulk access to the data. This is much more efficient than byte-by-byte access.

See Also

[Android Documentation]


Namespace: Java.IO
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:
Since: Added in API level 1