public class UnicodeBOMWriter extends Writer
OutputStreamWriter,
except that it adds a BOM (Byte Order Mark) at the beginning;
For documentation on the behavior in case of invalid Unicode sequences
(malformed surrogates, etc.) see the doc for OutputStreamWriter
Charset,
OutputStream,
OutputStreamWriter| Constructor and Description |
|---|
UnicodeBOMWriter(File file,
String charsetName)
Creates an UnicodeBOMWriter that uses the named charset.
|
UnicodeBOMWriter(String fileName,
String charsetName)
Creates an UnicodeBOMWriter that uses the named charset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
void |
write(char[] cbuf,
int off,
int len) |
public UnicodeBOMWriter(File file, String charsetName) throws IOException
file - The output File to write tocharsetName - The name of a supported CharsetIOException - If the encoding is not supported or any problems
writing to the streampublic UnicodeBOMWriter(String fileName, String charsetName) throws IOException
fileName - The name of the output filecharsetName - The name of a supported CharsetIOException - If the encoding is not supported or any problems
writing to the streampublic void write(char[] cbuf,
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 © 2021. All rights reserved.