Condividi tramite


FileWriter Constructors

Definition

Overloads

FileWriter(File)

Constructs a FileWriter given the File to write, using the platform's java.

FileWriter(FileDescriptor)

Constructs a FileWriter given a file descriptor, using the platform's java.

FileWriter(String)

Constructs a FileWriter given a file name, using the platform's java.

FileWriter(File, Charset)

Constructs a FileWriter given the File to write and java.

FileWriter(File, Boolean)

Constructs a FileWriter given the File to write and a boolean indicating whether to append the data written, using the platform's java.

FileWriter(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

FileWriter(String, Charset)

Constructs a FileWriter given a file name and java.

FileWriter(String, Boolean)

Constructs a FileWriter given a file name and a boolean indicating whether to append the data written, using the platform's java.

FileWriter(File, Charset, Boolean)

Constructs a FileWriter given the File to write, java.

FileWriter(String, Charset, Boolean)

Constructs a FileWriter given a file name, java.

FileWriter(File)

Constructs a FileWriter given the File to write, using the platform's java.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;)V", "")]
public FileWriter (Java.IO.File? file);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;)V", "")>]
new Java.IO.FileWriter : Java.IO.File -> Java.IO.FileWriter

Parameters

file
File

the File to write.

Attributes

Exceptions

if file cannot be opened for writing.

Remarks

Constructs a FileWriter given the File to write, using the platform's java.nio.charset.Charset#defaultCharset() default charset

Java documentation for java.io.FileWriter.FileWriter(java.io.File).

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

FileWriter(FileDescriptor)

Constructs a FileWriter given a file descriptor, using the platform's java.

[Android.Runtime.Register(".ctor", "(Ljava/io/FileDescriptor;)V", "")]
public FileWriter (Java.IO.FileDescriptor? fd);
[<Android.Runtime.Register(".ctor", "(Ljava/io/FileDescriptor;)V", "")>]
new Java.IO.FileWriter : Java.IO.FileDescriptor -> Java.IO.FileWriter

Parameters

fd
FileDescriptor

the FileDescriptor to write.

Attributes

Remarks

Constructs a FileWriter given a file descriptor, using the platform's java.nio.charset.Charset#defaultCharset() default charset.

Java documentation for java.io.FileWriter.FileWriter(java.io.FileDescriptor).

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

FileWriter(String)

Constructs a FileWriter given a file name, using the platform's java.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
public FileWriter (string? fileName);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
new Java.IO.FileWriter : string -> Java.IO.FileWriter

Parameters

fileName
String

String The system-dependent filename.

Attributes

Exceptions

if the file cannot be opened for writing.

Remarks

Constructs a FileWriter given a file name, using the platform's java.nio.charset.Charset#defaultCharset() default charset

Java documentation for java.io.FileWriter.FileWriter(java.lang.String).

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

FileWriter(File, Charset)

Constructs a FileWriter given the File to write and java.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;)V", "", ApiSince=33)]
public FileWriter (Java.IO.File? file, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;)V", "", ApiSince=33)>]
new Java.IO.FileWriter : Java.IO.File * Java.Nio.Charset.Charset -> Java.IO.FileWriter

Parameters

file
File

the File to write

charset
Charset

the java.nio.charset.Charset charset

Attributes

Remarks

Constructs a FileWriter given the File to write and java.nio.charset.Charset charset.

Added in 11.

Java documentation for java.io.FileWriter.FileWriter(java.io.File, java.nio.charset.Charset).

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

FileWriter(File, Boolean)

Constructs a FileWriter given the File to write and a boolean indicating whether to append the data written, using the platform's java.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Z)V", "")]
public FileWriter (Java.IO.File? file, bool append);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;Z)V", "")>]
new Java.IO.FileWriter : Java.IO.File * bool -> Java.IO.FileWriter

Parameters

file
File

the File to write

append
Boolean

if true, then bytes will be written to the end of the file rather than the beginning

Attributes

Exceptions

if the file cannot be opened for writing.

Remarks

Constructs a FileWriter given the File to write and a boolean indicating whether to append the data written, using the platform's java.nio.charset.Charset#defaultCharset() default charset.

Added in 1.4.

Java documentation for java.io.FileWriter.FileWriter(java.io.File, boolean).

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

FileWriter(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected FileWriter (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.IO.FileWriter : nativeint * Android.Runtime.JniHandleOwnership -> Java.IO.FileWriter

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

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

FileWriter(String, Charset)

Constructs a FileWriter given a file name and java.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/nio/charset/Charset;)V", "", ApiSince=33)]
public FileWriter (string? fileName, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/nio/charset/Charset;)V", "", ApiSince=33)>]
new Java.IO.FileWriter : string * Java.Nio.Charset.Charset -> Java.IO.FileWriter

Parameters

fileName
String

the name of the file to write

charset
Charset

the java.nio.charset.Charset charset

Attributes

Remarks

Constructs a FileWriter given a file name and java.nio.charset.Charset charset.

Added in 11.

Java documentation for java.io.FileWriter.FileWriter(java.lang.String, java.nio.charset.Charset).

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

FileWriter(String, Boolean)

Constructs a FileWriter given a file name and a boolean indicating whether to append the data written, using the platform's java.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Z)V", "")]
public FileWriter (string? fileName, bool append);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Z)V", "")>]
new Java.IO.FileWriter : string * bool -> Java.IO.FileWriter

Parameters

fileName
String

String The system-dependent filename.

append
Boolean

boolean if true, then data will be written to the end of the file rather than the beginning.

Attributes

Exceptions

if the file cannot be opened for writing.

Remarks

Constructs a FileWriter given a file name and a boolean indicating whether to append the data written, using the platform's java.nio.charset.Charset#defaultCharset() default charset.

Java documentation for java.io.FileWriter.FileWriter(java.lang.String, boolean).

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

FileWriter(File, Charset, Boolean)

Constructs a FileWriter given the File to write, java.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;Z)V", "", ApiSince=33)]
public FileWriter (Java.IO.File? file, Java.Nio.Charset.Charset? charset, bool append);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;Z)V", "", ApiSince=33)>]
new Java.IO.FileWriter : Java.IO.File * Java.Nio.Charset.Charset * bool -> Java.IO.FileWriter

Parameters

file
File

the File to write

charset
Charset

the java.nio.charset.Charset charset

append
Boolean

a boolean. If true, the writer will write the data to the end of the file rather than the beginning.

Attributes

Remarks

Constructs a FileWriter given the File to write, java.nio.charset.Charset charset and a boolean indicating whether to append the data written.

Added in 11.

Java documentation for java.io.FileWriter.FileWriter(java.io.File, java.nio.charset.Charset, boolean).

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

FileWriter(String, Charset, Boolean)

Constructs a FileWriter given a file name, java.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/nio/charset/Charset;Z)V", "", ApiSince=33)]
public FileWriter (string? fileName, Java.Nio.Charset.Charset? charset, bool append);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;Ljava/nio/charset/Charset;Z)V", "", ApiSince=33)>]
new Java.IO.FileWriter : string * Java.Nio.Charset.Charset * bool -> Java.IO.FileWriter

Parameters

fileName
String

the name of the file to write

charset
Charset

the java.nio.charset.Charset charset

append
Boolean

a boolean. If true, the writer will write the data to the end of the file rather than the beginning.

Attributes

Remarks

Constructs a FileWriter given a file name, java.nio.charset.Charset charset and a boolean indicating whether to append the data written.

Added in 11.

Java documentation for java.io.FileWriter.FileWriter(java.lang.String, java.nio.charset.Charset, boolean).

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