Compartir a través de


PrintStream Constructors

Definition

Overloads

PrintStream(File)

Creates a new print stream, without automatic line flushing, with the specified file.

PrintStream(Stream, Boolean, String)

Creates a new print stream.

PrintStream(String, String)

Creates a new print stream, without automatic line flushing, with the specified file name and charset.

PrintStream(String, Charset)

Creates a new print stream, without automatic line flushing, with the specified file name and charset.

PrintStream(Stream, Boolean)

Creates a new print stream.

PrintStream(Stream, Boolean, Charset)

Creates a new print stream, with the specified OutputStream, automatic line flushing and charset.

PrintStream(File, String)

Creates a new print stream, without automatic line flushing, with the specified file and charset.

PrintStream(File, Charset)

Creates a new print stream, without automatic line flushing, with the specified file and charset.

PrintStream(String)

Creates a new print stream, without automatic line flushing, with the specified file name.

PrintStream(Stream)

Creates a new print stream.

PrintStream(IntPtr, JniHandleOwnership)

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

PrintStream(File)

Creates a new print stream, without automatic line flushing, with the specified file.

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

Parameters

file
File

The file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.

Attributes

Exceptions

if an error occurs while opening or creating the target file.

Remarks

Java documentation for java.io.PrintStream.PrintStream(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

PrintStream(Stream, Boolean, String)

Creates a new print stream.

[Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;ZLjava/lang/String;)V", "")]
public PrintStream (System.IO.Stream? out, bool autoFlush, string? encoding);
[<Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;ZLjava/lang/String;)V", "")>]
new Java.IO.PrintStream : System.IO.Stream * bool * string -> Java.IO.PrintStream

Parameters

out
Stream

The output stream to which values and objects will be printed

autoFlush
Boolean

A boolean; if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written

encoding
String

The name of a supported "../lang/package-summary.html#charenc"> character encoding

Attributes

Exceptions

if out or charsetName are null.

if the encoding specified by charsetName is not supported.

Remarks

Java documentation for java.io.PrintStream.PrintStream(java.io.OutputStream, boolean, 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

PrintStream(String, String)

Creates a new print stream, without automatic line flushing, with the specified file name and charset.

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

Parameters

fileName
String

The name of the file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.

csn
String

The name of a supported java.nio.charset.Charset charset

Attributes

Exceptions

if an error occurs while opening or creating the target file.

if charsetName is null.

if the encoding specified by charsetName is not supported.

Remarks

Java documentation for java.io.PrintStream.PrintStream(java.lang.String, 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

PrintStream(String, Charset)

Creates a new print stream, without automatic line flushing, with the specified file name and charset.

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

Parameters

fileName
String

The name of the file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.

charset
Charset

A java.nio.charset.Charset charset

Attributes

Remarks

Java documentation for java.io.PrintStream.PrintStream(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

PrintStream(Stream, Boolean)

Creates a new print stream.

[Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;Z)V", "")]
public PrintStream (System.IO.Stream? out, bool autoFlush);
[<Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;Z)V", "")>]
new Java.IO.PrintStream : System.IO.Stream * bool -> Java.IO.PrintStream

Parameters

out
Stream

The output stream to which values and objects will be printed

autoFlush
Boolean

A boolean; if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written

Attributes

Exceptions

if out is null.

Remarks

Java documentation for java.io.PrintStream.PrintStream(java.io.OutputStream, 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

PrintStream(Stream, Boolean, Charset)

Creates a new print stream, with the specified OutputStream, automatic line flushing and charset.

[Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;ZLjava/nio/charset/Charset;)V", "", ApiSince=33)]
public PrintStream (System.IO.Stream? out, bool autoFlush, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;ZLjava/nio/charset/Charset;)V", "", ApiSince=33)>]
new Java.IO.PrintStream : System.IO.Stream * bool * Java.Nio.Charset.Charset -> Java.IO.PrintStream

Parameters

out
Stream

The output stream to which values and objects will be printed

autoFlush
Boolean

A boolean; if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written

charset
Charset

A java.nio.charset.Charset charset

Attributes

Remarks

Java documentation for java.io.PrintStream.PrintStream(java.io.OutputStream, boolean, 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

PrintStream(File, String)

Creates a new print stream, without automatic line flushing, with the specified file and charset.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/lang/String;)V", "")]
public PrintStream (Java.IO.File? file, string? csn);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/lang/String;)V", "")>]
new Java.IO.PrintStream : Java.IO.File * string -> Java.IO.PrintStream

Parameters

file
File

The file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.

csn
String

The name of a supported java.nio.charset.Charset charset

Attributes

Exceptions

if an error occurs while opening or creating the target file.

if charsetName is null.

if the encoding specified by charsetName is not supported.

Remarks

Java documentation for java.io.PrintStream.PrintStream(java.io.File, 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

PrintStream(File, Charset)

Creates a new print stream, without automatic line flushing, with the specified file and charset.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;)V", "", ApiSince=33)]
public PrintStream (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.PrintStream : Java.IO.File * Java.Nio.Charset.Charset -> Java.IO.PrintStream

Parameters

file
File

The file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.

charset
Charset

A java.nio.charset.Charset charset

Attributes

Remarks

Java documentation for java.io.PrintStream.PrintStream(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

PrintStream(String)

Creates a new print stream, without automatic line flushing, with the specified file name.

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

Parameters

fileName
String

The name of the file to use as the destination of this print stream. If the file exists, then it will be truncated to zero size; otherwise, a new file will be created. The output will be written to the file and is buffered.

Attributes

Exceptions

if an error occurs while opening or creating the target file.

Remarks

Java documentation for java.io.PrintStream.PrintStream(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

PrintStream(Stream)

Creates a new print stream.

[Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;)V", "")]
public PrintStream (System.IO.Stream? out);
[<Android.Runtime.Register(".ctor", "(Ljava/io/OutputStream;)V", "")>]
new Java.IO.PrintStream : System.IO.Stream -> Java.IO.PrintStream

Parameters

out
Stream

The output stream to which values and objects will be printed

Attributes

Exceptions

if out is null.

Remarks

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

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

PrintStream(IntPtr, JniHandleOwnership)

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

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

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