mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
implement StringWriter.getBuffer
This is used by json.org's JSON library.
This commit is contained in:
parent
e41133d268
commit
f25d5921a5
@ -11,7 +11,7 @@
|
|||||||
package java.io;
|
package java.io;
|
||||||
|
|
||||||
public class StringWriter extends Writer {
|
public class StringWriter extends Writer {
|
||||||
private final StringBuilder out = new StringBuilder();
|
private final StringBuffer out = new StringBuffer();
|
||||||
|
|
||||||
public void write(char[] b, int offset, int length) throws IOException {
|
public void write(char[] b, int offset, int length) throws IOException {
|
||||||
out.append(b, offset, length);
|
out.append(b, offset, length);
|
||||||
@ -24,4 +24,8 @@ public class StringWriter extends Writer {
|
|||||||
public void flush() throws IOException { }
|
public void flush() throws IOException { }
|
||||||
|
|
||||||
public void close() throws IOException { }
|
public void close() throws IOException { }
|
||||||
|
|
||||||
|
public StringBuffer getBuffer() {
|
||||||
|
return out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user