summaryrefslogtreecommitdiff
path: root/java/io/CharArrayWriter.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/io/CharArrayWriter.java')
-rw-r--r--java/io/CharArrayWriter.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/java/io/CharArrayWriter.java b/java/io/CharArrayWriter.java
index 4593f15c7..46995f4a2 100644
--- a/java/io/CharArrayWriter.java
+++ b/java/io/CharArrayWriter.java
@@ -242,6 +242,41 @@ public class CharArrayWriter extends Writer
}
}
+ /** @since 1.5 */
+ public CharArrayWriter append(char c)
+ {
+ write(c);
+ return this;
+ }
+
+ /** @since 1.5 */
+ public CharArrayWriter append(CharSequence cs)
+ {
+ try
+ {
+ write(cs == null ? "null" : cs.toString());
+ }
+ catch (IOException _)
+ {
+ // Can't happen.
+ }
+ return this;
+ }
+
+ /** @since 1.5 */
+ public CharArrayWriter append(CharSequence cs, int start, int end)
+ {
+ try
+ {
+ write(cs == null ? "null" : cs.subSequence(start, end).toString());
+ }
+ catch (IOException _)
+ {
+ // Can't happen.
+ }
+ return this;
+ }
+
/**
* This private method makes the buffer bigger when we run out of room
* by allocating a larger buffer and copying the valid chars from the