public class WriterOutputStream
extends java.io.OutputStream
| Modifier and Type | Field and Description |
|---|---|
private java.nio.charset.CharsetDecoder |
decoder |
private java.nio.ByteBuffer |
inputBuffer |
private java.nio.CharBuffer |
outputBuffer |
private java.io.Writer |
writer |
| Constructor and Description |
|---|
WriterOutputStream(java.io.Writer writer)
Construct a new instance using the default charset.
|
WriterOutputStream(java.io.Writer writer,
java.nio.charset.Charset charset)
Construct a new instance using the given charset.
|
WriterOutputStream(java.io.Writer writer,
java.nio.charset.CharsetDecoder decoder)
Construct a new instance using the given charset decoder.
|
WriterOutputStream(java.io.Writer writer,
java.lang.String charsetName)
Construct a new instance using the named charset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
private void |
finish() |
void |
flush() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
private final java.io.Writer writer
private final java.nio.charset.CharsetDecoder decoder
private final java.nio.ByteBuffer inputBuffer
private final java.nio.CharBuffer outputBuffer
public WriterOutputStream(java.io.Writer writer)
writer - the writer to write topublic WriterOutputStream(java.io.Writer writer,
java.lang.String charsetName)
writer - the writer to write tocharsetName - the charset namepublic WriterOutputStream(java.io.Writer writer,
java.nio.charset.Charset charset)
writer - the writer to write tocharset - the charsetpublic WriterOutputStream(java.io.Writer writer,
java.nio.charset.CharsetDecoder decoder)
writer - the writer to write todecoder - the charset decoderpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionprivate void finish()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOException