Package org.jline.utils
Class WriterOutputStream
java.lang.Object
java.io.OutputStream
org.jline.utils.WriterOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Redirects an
OutputStream to a Writer by decoding the data
using the specified Charset.
Note: This class should only be used if it is necessary to
redirect an OutputStream to a Writer for compatibility
purposes. It is much more efficient to write to the Writer
directly.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CharsetDecoderprivate final ByteBufferprivate final CharBufferprivate final Writer -
Constructor Summary
ConstructorsConstructorDescriptionWriterOutputStream(Writer out, Charset charset) WriterOutputStream(Writer out, CharsetDecoder decoder) -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
out
-
decoder
-
decoderIn
-
decoderOut
-
-
Constructor Details
-
WriterOutputStream
-
WriterOutputStream
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
processInput
Decode the contents of the input ByteBuffer into a CharBuffer.- Parameters:
endOfInput- indicates end of input- Throws:
IOException- if an I/O error occurs
-
flushOutput
Flush the output.- Throws:
IOException- if an I/O error occurs
-