public class DecodingOutputStream extends OutputStream
| Constructor and Description |
|---|
DecodingOutputStream(Writer out,
String charset)Create a DecodingOutputStream that decodes bytes and writes characters to the given Writer. |
| Modifier and Type | Method and Description |
|---|---|
void | close()Only flushes. |
void | flush()Flush any buffered bytes through the decoder. |
void | write(byte[] buf,
int off,
int len)Write bytes to be decoded. |
void | write(int b)Write a single byte to be decoded. |
writepublic DecodingOutputStream(Writer out, String charset) throws UnsupportedEncodingException
out - the Writer to write decoded characters tocharset - the charset to decode (e.g. "UTF-8")UnsupportedEncodingException - on unknown charsetpublic void close()
throws IOExceptionclose in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOExceptionflush in interface Flushableflush in class OutputStreamIOException - on I/O errorpublic void write(byte[] buf,
int off,
int len)
throws IOExceptionwrite in class OutputStreambuf - the buffer of bytes to writeoff - the start offset in the bufferlen - the number of bytes to writeIOException - on I/O errorpublic void write(int b)
throws IOExceptionwrite in class OutputStreamb - the byte to writeIOException - on I/O error