aboutsummaryrefslogtreecommitdiff
path: root/src/rejava/io/StringWriter.java
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-05-04 17:37:41 +0200
committerPacien TRAN-GIRARD2014-05-04 17:37:41 +0200
commit688634ae5a5aaf663159032e67d2132ea61c5d5f (patch)
treee0642498c904e8a9373df479239fbfc603a957d3 /src/rejava/io/StringWriter.java
parent780bae6cd1a4d2a81b8c3ed72ee5d73cee9b5ccb (diff)
downloadesieequest-688634ae5a5aaf663159032e67d2132ea61c5d5f.tar.gz
Implement "save" and "load"
Diffstat (limited to 'src/rejava/io/StringWriter.java')
-rw-r--r--src/rejava/io/StringWriter.java29
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 @@
1package 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 */
10public 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