Java.IO.FileOutputStream Class
An output stream that writes bytes to a file.

See Also: FileOutputStream Members

Syntax

[Android.Runtime.Register("java/io/FileOutputStream", DoNotGenerateAcw=true)]
public class FileOutputStream : OutputStream

Remarks

An output stream that writes bytes to a file. If the output file exists, it can be replaced or appended to. If it does not exist, a new file will be created.

java Example

File file = ...
   OutputStream out = null;
   try {
     out = new BufferedOutputStream(new FileOutputStream(file));
     ...
    finally {
     if (out != null) {
       out.close();
     }
   }
 }

This stream is not buffered. Most callers should wrap this stream with a Java.IO.BufferedOutputStream.

Use Java.IO.FileWriter to write characters, as opposed to bytes, to a file.

See Also

[Android Documentation]

Requirements

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