public class EncodingDetectingOutputStreamWriter extends Writer
OutputStreamWriter but it tries to autodetect the encoding of the
OutputStream. This works at least if the OutputStream is XML, which is a very common thing to be for Resources.
For this to work at least the first part (e.g. the first 100 bytes) need to be buffered.
If determining the encoding did not succeed it is supposed to be 'UTF-8', which is (should be) an
acceptable encoding, and also the default encoding for XML streams.| Constructor and Description |
|---|
EncodingDetectingOutputStreamWriter(OutputStream os) |
EncodingDetectingOutputStreamWriter(OutputStream os)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void write(char[] cbuf)
throws IOException
write in class WriterIOExceptionpublic void write(int c)
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 write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}