API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.io. PrintWriter View Source
Author(s)
Frank Yellin
Mark Reinhold
Since
JDK1.1
Version
1.43, 08/07/06
Serial
Hierarchy
 Object
      Writer
          PrintWriter
Implements
Subclasses
Description
public class PrintWriter
  Prints formatted representations of objects to a text-output stream.
See also:   
Constructors
public PrintWriter (File file) throws FileNotFoundException
  Creates a new PrintWriter, without automatic line flushing, with the specified file.
public PrintWriter (File file, String csn) throws FileNotFoundException UnsupportedEncodingException
  Creates a new PrintWriter, without automatic line flushing, with the specified file and charset.
public PrintWriter (OutputStream out)
  Creates a new PrintWriter, without automatic line flushing, from an existing OutputStream.
public PrintWriter (OutputStream out, boolean autoFlush)
  Creates a new PrintWriter from an existing OutputStream.
public PrintWriter (String fileName) throws FileNotFoundException
  Creates a new PrintWriter, without automatic line flushing, with the specified file name.
public PrintWriter (String fileName, String csn) throws FileNotFoundException UnsupportedEncodingException
  Creates a new PrintWriter, without automatic line flushing, with the specified file name and charset.
public PrintWriter (Writer out)
  Creates a new PrintWriter, without automatic line flushing.
public PrintWriter (Writer out, boolean autoFlush)
  Creates a new PrintWriter.
Methods
Hide/Show inherited methods
public PrintWriter append (char c) [Overrides Writer]
  Appends the specified character to this writer.
public PrintWriter append (CharSequence csq) [Overrides Writer]
  Appends the specified character sequence to this writer.
public PrintWriter append (CharSequence csq, int start, int end) [Overrides Writer]
  Appends a subsequence of the specified character sequence to this writer.
public boolean checkError ()
  Flushes the stream if it's not closed and checks its error state.
protected void clearError ()
  Clears the error state of this stream.
public void close () [Specified in Writer]
  Closes the stream and releases any system resources associated with it.
public void flush () [Specified in Writer]
  Flushes the stream.
public PrintWriter format (Locale l, String format, Object args)
  Writes a formatted string to this writer using the specified format string and arguments.
public PrintWriter format (String format, Object args)
  Writes a formatted string to this writer using the specified format string and arguments.
public void print (boolean b)
  Prints a boolean value.
public void print (char c)
  Prints a character.
public void print (char[] s)
  Prints an array of characters.
public void print (double d)
  Prints a double-precision floating-point number.
public void print (float f)
  Prints a floating-point number.
public void print (int i)
  Prints an integer.
public void print (long l)
  Prints a long integer.
public void print (Object obj)
  Prints an object.
public void print (String s)
  Prints a string.
public PrintWriter printf (Locale l, String format, Object args)
  A convenience method to write a formatted string to this writer using the specified format string and arguments.
public PrintWriter printf (String format, Object args)
  A convenience method to write a formatted string to this writer using the specified format string and arguments.
public void println ()
  Terminates the current line by writing the line separator string.
public void println (boolean x)
  Prints a boolean value and then terminates the line.
public void println (char x)
  Prints a character and then terminates the line.
public void println (char[] x)
  Prints an array of characters and then terminates the line.
public void println (double x)
  Prints a double-precision floating-point number and then terminates the line.
public void println (float x)
  Prints a floating-point number and then terminates the line.
public void println (int x)
  Prints an integer and then terminates the line.
public void println (long x)
  Prints a long integer and then terminates the line.
public void println (Object x)
  Prints an Object and then terminates the line.
public void println (String x)
  Prints a String and then terminates the line.
protected void setError ()
  Indicates that an error has occurred.
public void write (char[] buf) [Overrides Writer]
  Writes an array of characters.
public void write (char[] buf, int off, int len) [Specified in Writer]
  Writes A Portion of an array of characters.
public void write (int c) [Overrides Writer]
  Writes a single character.
public void write (String s) [Overrides Writer]
  Writes a string.
public void write (String s, int off, int len) [Overrides Writer]
  Writes a portion of a string.
Fields
Hide/Show inherited fields
protected Object lock [Inherited From Writer]
  The object used to synchronize operations on this stream.
protected Writer out
  The underlying character-output stream of this PrintWriter.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar