Android Guides | Samples

Java.IO.PrintWriter Class

Wraps either an existing OutputStream or an existing Writer and provides convenience methods for printing common data types in a human readable format.

See Also: PrintWriter

Syntax

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

Remarks

Wraps either an existing OutputStream or an existing Writer and provides convenience methods for printing common data types in a human readable format. No IOException is thrown by this class. Instead, callers should use PrintWriter.CheckError to see if a problem has occurred in this writer.

[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

The members of Java.IO.PrintWriter are listed below.

See Also: Writer

Public Constructors

Constructs a new PrintWriter with file as its target.
Constructs a new PrintWriter with wr as its target writer.
Constructs a new PrintWriter with out as its target stream.
Constructs a new PrintWriter with the file identified by fileName as its target.
Constructs a new PrintWriter with file as its target.
Constructs a new PrintWriter with out as its target writer.
Constructs a new PrintWriter with out as its target stream.
Constructs a new PrintWriter with the file identified by fileName as its target.

Protected Constructors

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

Protected Properties

OutWriter. The writer to print data to.
[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

CheckError() : Boolean
Flushes this writer and returns the value of the error flag.
override
Close()
Closes this print writer.
override
Flush()
Ensures that all pending data is sent out to the target.
Format(String, params Object[]) : PrintWriter
Format(Locale, String, params Object[]) : PrintWriter
FormatAsync(String, params Object[]) : System.Threading.Tasks.Task<PrintWriter>
FormatAsync(Locale, String, params Object[]) : System.Threading.Tasks.Task<PrintWriter>
Print(Object)
Prints the string representation of the specified object to the target.
Print(Boolean)
Prints the string representation of the specified boolean to the target.
Print(Char)
Prints the string representation of the specified character to the target.
Print(Char[])
Prints the string representation of the specified character array to the target.
Print(Double)
Prints the string representation of the specified double to the target.
Print(Int32)
Prints the string representation of the specified integer to the target.
Print(Int64)
Prints the string representation of the specified long to the target.
Print(Single)
Prints the string representation of the specified float to the target.
Print(String)
Prints a string to the target.
PrintAsync(Object) : Task
PrintAsync(Boolean) : Task
PrintAsync(Char) : Task
PrintAsync(Char[]) : Task
PrintAsync(Double) : Task
PrintAsync(Int32) : Task
PrintAsync(Int64) : Task
PrintAsync(Single) : Task
PrintAsync(String) : Task
Printf(String, params Object[]) : PrintWriter
Printf(Locale, String, params Object[]) : PrintWriter
PrintfAsync(String, params Object[]) : System.Threading.Tasks.Task<PrintWriter>
PrintfAsync(Locale, String, params Object[]) : System.Threading.Tasks.Task<PrintWriter>
Println()
Prints a newline.
Println(Object)
Prints the string representation of the object o, or "null, followed by a newline.
Println(Boolean)
Prints the string representation of the boolean b followed by a newline.
Println(Char)
Prints the string representation of the char c followed by a newline.
Println(Char[])
Prints the string representation of the character array chars followed by a newline.
Println(Double)
Prints the string representation of the double d followed by a newline.
Println(Int32)
Prints the string representation of the int i followed by a newline.
Println(Int64)
Prints the string representation of the long l followed by a newline.
Println(Single)
Prints the string representation of the float f followed by a newline.
Println(String)
Prints the string representation of the string s followed by a newline.
PrintlnAsync() : Task
PrintlnAsync(Object) : Task
PrintlnAsync(Boolean) : Task
PrintlnAsync(Char) : Task
PrintlnAsync(Char[]) : Task
PrintlnAsync(Double) : Task
PrintlnAsync(Int32) : Task
PrintlnAsync(Int64) : Task
PrintlnAsync(Single) : Task
PrintlnAsync(String) : Task
override
Write(Char[], Int32, Int32)
Writes count characters from buffer starting at offset to the target.

Protected Methods

ClearError()
Sets the error state of the stream to false.
SetError()
Sets the error flag of this writer to true.