package rejava.io; /** * A minimal subset of java.io.StringReader. * (http://hg.openjdk.java.net/jdk7/jdk7/jdk/file * /9b8c96f96a0f/src/share/classes/java/io/StringWriter.java) * * @author Pacien TRAN-GIRARD */ public class StringWriter extends Writer { private final StringBuilder buf = new StringBuilder(); @Override public void write(final String str) { this.buf.append(str); } @Override public void write(final char c) { this.buf.append(c); } @Override public String toString() { return this.buf.toString(); } }