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 voidvoidclose()voidflush()voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidvoidMethods 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:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
checkNotClosed
- Throws:
IOException
-