← 返回首页
StringWriter (Java SE 26 & JDK 26)
JavaScript is disabled on your browser.
Contents  
  1. Description
  2. Field Summary
  3. Constructor Summary
  4. Method Summary
    1. Methods declared in class Writer
    2. Methods declared in class Object
  5. Constructor Details
    1. StringWriter()
    2. StringWriter(int)
  6. Method Details
    1. write(int)
    2. write(char[], int, int)
    3. write(String)
    4. write(String, int, int)
    5. append(CharSequence)
    6. append(CharSequence, int, int)
    7. append(char)
    8. toString()
    9. getBuffer()
    10. flush()
    11. close()
Hide sidebar  Show sidebar

Class StringWriter

java.lang.Object
java.io.Writer
java.io.StringWriter
All Implemented Interfaces: Closeable, Flushable, Appendable, AutoCloseable
public class StringWriter extends Writer
A character stream that collects its output in a string buffer, which can then be used to construct a string.

Closing a StringWriter has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

Since: 1.1

Scripting on this page tracks web page traffic, but does not change the content in any way.