public class StringBuilderWriter
extends java.io.Writer
implements java.lang.CharSequence
StringBuilder
to implement the Writer
interface.Constructor and Description |
---|
StringBuilderWriter(java.lang.StringBuilder stringBuilder)
Constructs a new writer with the provided
StringBuilder to write to. |
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
append(char c) |
java.io.Writer |
append(java.lang.CharSequence cSeq) |
java.io.Writer |
append(java.lang.CharSequence cSeq,
int start,
int end) |
char |
charAt(int index) |
void |
close() |
void |
flush() |
int |
length() |
java.lang.CharSequence |
subSequence(int start,
int end) |
void |
write(char[] cbuf) |
void |
write(char[] cbuf,
int offset,
int len) |
void |
write(int c) |
public StringBuilderWriter(java.lang.StringBuilder stringBuilder)
StringBuilder
to write to.stringBuilder
- string builder to write to, can not be null
public java.io.Writer append(char c)
append
in interface java.lang.Appendable
append
in class java.io.Writer
public java.io.Writer append(java.lang.CharSequence cSeq)
append
in interface java.lang.Appendable
append
in class java.io.Writer
public java.io.Writer append(java.lang.CharSequence cSeq, int start, int end)
append
in interface java.lang.Appendable
append
in class java.io.Writer
public void write(int c)
write
in class java.io.Writer
public void write(char[] cbuf)
write
in class java.io.Writer
public void write(char[] cbuf, int offset, int len)
write
in class java.io.Writer
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
public int length()
length
in interface java.lang.CharSequence
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence