API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.io. StringWriter View Source
Author(s)
Mark Reinhold
Since
JDK1.1
Version
1.26, 05/11/17
Serial
Hierarchy
 Object
      Writer
          StringWriter
Implements
Subclasses
Description
public class StringWriter
  A character stream that collects its output in a string buffer, which can then be used to construct a string.
See also:   
Constructors
public StringWriter ()
Create a new string writer using the default initial string-buffer size.
public StringWriter (int initialSize)
  Create a new string writer using the specified initial string-buffer size.
Methods
Hide/Show inherited methods
public StringWriter append (char c) [Overrides Writer]
  Appends the specified character to this writer.
public StringWriter append (CharSequence csq) [Overrides Writer]
  Appends the specified character sequence to this writer.
public StringWriter append (CharSequence csq, int start, int end) [Overrides Writer]
  Appends a subsequence of the specified character sequence to this writer.
public void close () throws IOException [Specified in Writer]
  Closing a StringWriter has no effect.
public void flush () [Specified in Writer]
Flush the stream.
public StringBuffer getBuffer ()
  Return the string buffer itself.
public String toString ()
Return the buffer's current value as a string.
public void write (char[] cbuf) throws IOException [Inherited From Writer]
  Writes an array of characters.
public void write (char[] cbuf, int off, int len) [Specified in Writer]
  Write a portion of an array of characters.
public void write (int c) [Overrides Writer]
Write a single character.
public void write (String str) [Overrides Writer]
Write a string.
public void write (String str, int off, int len) [Overrides Writer]
  Write 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.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar