Package com.google.common.io
Class AppendableWriter
java.lang.Object
java.io.Writer
com.google.common.io.AppendableWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
Writer that places all output on an
Appendable
target. If the target is Flushable
or Closeable
, flush()es and close()s will also be delegated to the target.- Since:
- 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAppendableWriter
(Appendable target) Creates a new writer that appends everything it writes totarget
. -
Method Summary
Modifier and TypeMethodDescriptionappend
(char c) append
(CharSequence charSeq) append
(CharSequence charSeq, int start, int end) private void
void
close()
void
flush()
void
write
(char[] cbuf, int off, int len) void
write
(int c) void
void
Methods inherited from class java.io.Writer
nullWriter, write
-
Field Details
-
target
-
closed
private boolean closed
-
-
Constructor Details
-
AppendableWriter
AppendableWriter(Appendable target) Creates a new writer that appends everything it writes totarget
.- Parameters:
target
- target to which to append output
-
-
Method Details
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
checkNotClosed
- Throws:
IOException
-