java.lang.Object
java.io.Writer
org.bzdev.io.AppendableWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
Writer that writes to an Appendable.
This class allows a Writer to be used to add text to an Appendable.
For example
new PrintWriter(new AppendableWriter(appendable)
creates a PrintWriter that can write formatted text to
appendable
(whose class is, of course,
Appendable
).
The implementation is thread-safe.-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AppendableWriter
Consructor.- Parameters:
appendable
- the appendable to write to
-
-
Method Details
-
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
-
write
- Specified by:
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
-