class AppendableWriter
extends java.io.Writer
Appendable
target. If the target is Flushable
or Closeable
, flush()es and close()s will also be delegated to the target.Modifier and Type | Field and Description |
---|---|
private boolean |
closed |
private java.lang.Appendable |
target |
Constructor and Description |
---|
AppendableWriter(java.lang.Appendable target)
Creates a new writer that appends everything it writes to
target . |
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
append(char c) |
java.io.Writer |
append(java.lang.CharSequence charSeq) |
java.io.Writer |
append(java.lang.CharSequence charSeq,
int start,
int end) |
private void |
checkNotClosed() |
void |
close() |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(java.lang.String str) |
void |
write(java.lang.String str,
int off,
int len) |
AppendableWriter(java.lang.Appendable target)
target
.target
- target to which to append outputpublic void write(char[] cbuf, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(int c) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(java.lang.String str) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void write(java.lang.String str, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
java.io.IOException
public java.io.Writer append(char c) throws java.io.IOException
append
in interface java.lang.Appendable
append
in class java.io.Writer
java.io.IOException
public java.io.Writer append(java.lang.CharSequence charSeq) throws java.io.IOException
append
in interface java.lang.Appendable
append
in class java.io.Writer
java.io.IOException
public java.io.Writer append(java.lang.CharSequence charSeq, int start, int end) throws java.io.IOException
append
in interface java.lang.Appendable
append
in class java.io.Writer
java.io.IOException
private void checkNotClosed() throws java.io.IOException
java.io.IOException