public class HTMLWriter
extends java.io.Writer
Note that if encoding
parameter of the
constructor
is null, no encoding
declaration is added, and the file is written in OS-default encoding. This is
done to fix a bug [1.6
RC2] Bug with Target Encoding set to <auto> for (x)HTML.
Constructor and Description |
---|
HTMLWriter(java.lang.String fileName,
java.lang.String encoding,
HTMLOptions options)
Creates new HTMLWriter.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Flushes the writer (which does the real write-out of data) and closes the
real writer.
|
void |
flush()
Does the real write-out of the data, first adding/replacing encoding
statement.
|
void |
write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters.
|
public HTMLWriter(java.lang.String fileName, java.lang.String encoding, HTMLOptions options) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
fileName
- - file name to write toencoding
- - the encoding to write HTML file in (null means OS-default
encoding)java.io.FileNotFoundException
java.io.UnsupportedEncodingException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
public void write(@NotNull char[] cbuf, int off, int len) throws java.io.IOException
write(char[], int, int)
of the internal
StringWriter
.write
in class java.io.Writer
cbuf
- - Array of charactersoff
- - Offset from which to start writing characterslen
- - Number of characters to writejava.io.IOException
- - If an I/O error occurs