public class StringBufferWriter
extends java.io.Writer
implements java.lang.CharSequence
StringBuffer
to implement the Writer
interface.Constructor and Description |
---|
StringBufferWriter(java.lang.StringBuffer stringBuffer)
Constructs a new writer with the provided
StringBuffer 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 StringBufferWriter(java.lang.StringBuffer stringBuffer)
StringBuffer
to write to.stringBuffer
- string buffer 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