public class UTF8OutputStreamWriter extends Writer
This class is used to write a stream of chars as a stream of bytes using the UTF8 encoding. It assumes that the underlying output stream is buffered or does not need additional buffering.
It is more efficient than using a OutputStreamWriter
because it does not need to be wrapped in a
BufferedWriter. Creating multiple instances
of BufferedWriter has been shown to be very expensive.
copy from: com.sun.xml.internal.stream.writers.UTF8OutputStreamWriter
| Constructor and Description |
|---|
UTF8OutputStreamWriter(OutputStream out)
Creates a new UTF8OutputStreamWriter.
|
public UTF8OutputStreamWriter(OutputStream out)
out - The underlying output stream.public void write(int c)
throws IOException
write in class WriterIOExceptionpublic void write(char[] cbuf)
throws IOException
write in class WriterIOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionpublic void write(String str) throws IOException
write in class WriterIOExceptionpublic void write(String str, int off, int len) throws IOException
write in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionCopyright © 2025. All rights reserved.