Writer : Writer « File « Java Tutorial






  1. The abstract class 'Writer' defines a stream used for writing characters.
  2. OutputStreamWriter translates the characters into byte streams using a given character set.
  3. FileWriter is a child class of OutputStreamWriter that provides a convenient way to write characters to a file.
  4. When using FileWriter you are forced to output characters using the computer's encoding.
  5. A better alternative to FileWriter is PrintWriter.
  1. Writer deals with characters instead of bytes.
  2. Writer class has three write method overloads:
public void write (int b)
public void write (char[] text)
public void write (char[] text, int offset, int length)
public void write (String text)
public void write (String text, int offset, int length)








11.32.Writer
11.32.1.Writer
11.32.2.A string writer that is able to write large amounts of data.
11.32.3.Implementation of a fast Writer.
11.32.4.Provides Closable semantics ordinarily missing in a {@link java.io.CharArrayWriter}.
11.32.5.Write the entire contents of the supplied string to the given writer. This method always flushes and closes the writer when finished.
11.32.6.Null Writer