public class Utf8OutputStreamWriter extends Writer
Utf8InputStreamReader
Constructor and Description |
---|
Utf8OutputStreamWriter(OutputStream outputStream)
Constructs a new OutputStreamWriter using
out as the target stream to write converted characters to. |
Utf8OutputStreamWriter(OutputStream outputStream,
boolean closeOuterStream)
Constructs a new OutputStreamWriter using
out as the target stream to write converted characters to. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this writer.
|
void |
flush()
Flushes this writer.
|
void |
write(char[] buf,
int offset,
int count)
Writes
count characters starting at offset in buf to this writer. |
getLineSeparator, setLineSeparator, write, write, write, write, writeln, writeln
public Utf8OutputStreamWriter(OutputStream outputStream)
out
as the target stream to write converted characters to.outputStream
- the non-null target stream to write converted bytes topublic Utf8OutputStreamWriter(OutputStream outputStream, boolean closeOuterStream)
out
as the target stream to write converted characters to.outputStream
- the non-null target stream to write converted bytes tocloseOuterStream
- whether or not to close the outer stream when this stream is closepublic void close()
Writer
close
in interface java.lang.AutoCloseable
close
in class Writer
IOException
- if an error occurs while closing this writer.public void flush()
flush
in class Writer
IOException
- if an error occurs while flushing this writerpublic void write(char[] buf, int offset, int count)
count
characters starting at offset
in buf
to this writer. The characters are
immediately converted to bytes by the character converter and stored in a local buffer. If the buffer gets full
as a result of the conversion, this writer is flushed.write
in class Writer
buf
- the array containing characters to write.offset
- the index of the first character in buf
to write.count
- the maximum number of characters to write.java.lang.IndexOutOfBoundsException
- if offset < 0
or count < 0
, or if offset + count
is
greater than the size of buf
.IOException
- if this writer has already been closed or another I/O error occurs.