diff options
author | Pacien TRAN-GIRARD | 2014-05-05 20:25:53 +0000 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2014-05-05 20:25:53 +0000 |
commit | c67f1d95464d1d6c2854c59a920a2b3ea975df0f (patch) | |
tree | bf84b623ddec71edfbfc68f16d5530a3e11f7155 /src/rejava/io/StringWriter.java | |
parent | 0a87883db4d8e1728c1f520deda15e6e79ff1f01 (diff) | |
parent | b8cafdd1c70b3fbb455ee6821c3dd0e5dc587188 (diff) | |
download | esieequest-c67f1d95464d1d6c2854c59a920a2b3ea975df0f.tar.gz |
Merge branch 'zuul-awesome' into 'master'
Zuul Awesome
Diffstat (limited to 'src/rejava/io/StringWriter.java')
-rw-r--r-- | src/rejava/io/StringWriter.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/rejava/io/StringWriter.java b/src/rejava/io/StringWriter.java new file mode 100644 index 0000000..cee4c97 --- /dev/null +++ b/src/rejava/io/StringWriter.java | |||
@@ -0,0 +1,29 @@ | |||
1 | package rejava.io; | ||
2 | |||
3 | /** | ||
4 | * A minimal subset of java.io.StringReader. | ||
5 | * (http://hg.openjdk.java.net/jdk7/jdk7/jdk/file | ||
6 | * /9b8c96f96a0f/src/share/classes/java/io/StringWriter.java) | ||
7 | * | ||
8 | * @author Pacien TRAN-GIRARD | ||
9 | */ | ||
10 | public class StringWriter extends Writer { | ||
11 | |||
12 | private final StringBuilder buf = new StringBuilder(); | ||
13 | |||
14 | @Override | ||
15 | public void write(final String str) { | ||
16 | this.buf.append(str); | ||
17 | } | ||
18 | |||
19 | @Override | ||
20 | public void write(final char c) { | ||
21 | this.buf.append(c); | ||
22 | } | ||
23 | |||
24 | @Override | ||
25 | public String toString() { | ||
26 | return this.buf.toString(); | ||
27 | } | ||
28 | |||
29 | } \ No newline at end of file | ||