IOException, SecurityException
java.io.PrintWriter (class)
Constructors:
PrintWriter(Writer o);
PrintWriter(Writer o, boolean autoFlush);
PrintWriter(OutputStream o);
PrintWriter(OutputStream o, boolean autoFlush);
General Description: This class does some translation from data-types into readable text. The autoFlush flag forces a flush on when the program calls println().
Parent Class: Writer
Methods
boolean checkError(); Flush stream and check for any errors.
void close(); Close this channel.
void defaultWriteObject(); Write the current class' non-static and non-transient fields to this stream. You can only call this while in the writeObject() method during serialization.
int flush(); Flush written data from buffers.
int reset(); Toss the information written to the stream.
void write(byte b);
int write(byte[] arr); int write(byte[] arr, int
offset, int len); Write a byte or an array of bytes beginning at offset for len bytes.
void print(boolean b);
void print(char c);
void print(char[] s);
void print(double d);
void print(float f);
void print(int i);
void print(long l);
void print(Object obj);
void print(String s); Print the designated type. The Object type uses the String.valueOf() method to convert data.
void println();
void println(boolean b);
void println(char c);
void println(char[] s);
void println(double d);
void println(float f);
void println(int i);
void println(long l);
void println(Object obj);
void println(String s); Print the designated type and terminate line with newline. If autoFlush is enabled, flush the stream.
void write(int b); Write a single byte to the stream.
int write(char[] arr); Write an array of char (arr) to stream.int write(char[] arr, int
offset, int len); Write an array of char (arr) beginning at offset for len bytes.
int write(String s); Write string to stream.int write(String s, int
offset, int len); Write string to stream beginning at offset for len bytes.
Exceptions Thrown
PD: Could someone create a graphic here?Class HierarchyObject <- Socket<- ServerSocket<- DatagramSocket <- MulticastSocketPD: End Graphic