Package dev.enola.common
Class StringBuilderWriter
java.lang.Object
java.io.Writer
dev.enola.common.StringBuilderWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Writer implementation that outputs to a StringBuilder.
This is alternative to StringWriter, which internally uses a StringBuffer. This is faster (!) - at the expense of not (!) being concurrency multi thread safe
- which often is not required.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.Writer
append, append, nullWriter
-
Constructor Details
-
StringBuilderWriter
public StringBuilderWriter()
-
-
Method Details
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
toString
-
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
-