Class TeeWriter
java.lang.Object
java.io.Writer
io.github.ascopes.jct.diagnostics.TeeWriter
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Get the content of the internal buffer.toString()Get the content of the internal buffer.static TeeWriterwrapOutputStream(OutputStream outputStream, Charset charset) Create a tee writer for the given output stream.voidwrite(char[] buffer, int offset, int length)
-
Constructor Details
-
TeeWriter
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
getContent
Get the content of the internal buffer.- Returns:
- the content.
- Since:
- 0.2.1
-
toString
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
wrapOutputStream
Create a tee writer for the given output stream.Remember you may need to manually flush the tee writer for all contents to be committed to the output stream.
- Parameters:
outputStream- the output stream.charset- the charset.- Returns:
- the Tee Writer.
- Since:
- 0.2.1
-