public final class UTF8Writer extends java.io.Writer implements UnicodeWriter
| Constructor and Description |
|---|
UTF8Writer(java.io.OutputStream out) |
UTF8Writer(java.io.OutputStream out,
int bufferLength) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Complete the writing of characters to the result.
|
void |
flush()
Flush the contents of any buffers.
|
void |
write(char[] cbuf) |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c)
Write a single char.
|
void |
write(java.lang.String str)
Process a supplied string
|
void |
write(java.lang.String str,
int off,
int len) |
void |
write(UnicodeString chars)
Process a supplied string
|
void |
writeAscii(byte[] content)
Write a sequence of ASCII characters.
|
void |
writeAscii(byte[] chars,
int off,
int len)
Write a sequence of ASCII characters.
|
void |
writeCodePoint(int codepoint)
Process a single character.
|
void |
writeLatin1(byte[] bytes,
int off,
int len) |
void |
writeRepeatedAscii(byte ch,
int repeat)
Write an ASCII character repeatedly.
|
public UTF8Writer(java.io.OutputStream out)
public UTF8Writer(java.io.OutputStream out,
int bufferLength)
public void close()
throws java.io.IOException
UnicodeWriterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface UnicodeWriterclose in class java.io.Writerjava.io.IOException - if processing fails for any reasonpublic void flush()
throws java.io.IOException
UnicodeWriterflush in interface java.io.Flushableflush in interface UnicodeWriterflush in class java.io.Writerjava.io.IOException - if processing fails for any reasonpublic void write(char[] cbuf)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void writeLatin1(byte[] bytes,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void writeAscii(byte[] content)
throws java.io.IOException
writeAscii in interface UnicodeWritercontent - the content to be writtenjava.io.IOException - if processing fails for any reasonpublic void writeAscii(byte[] chars,
int off,
int len)
throws java.io.IOException
chars - the characters to be writtenoff - the offset of the first character to be includedlen - the number of characters to be writtenjava.io.IOExceptionpublic void writeRepeatedAscii(byte ch,
int repeat)
throws java.io.IOException
writeRepeatedAscii in interface UnicodeWriterch - the ASCII character to be serialized (must be less than 0x7f)repeat - the number of occurrences to outputjava.io.IOException - if it failspublic void writeCodePoint(int codepoint)
throws java.io.IOException
UnicodeStringwriteCodePoint in interface UnicodeWritercodepoint - the character to be processed. Must not be a surrogatejava.io.IOException - if processing fails for any reasonpublic void write(int c)
throws java.io.IOException
Note (MHK) Although the Writer interface says that the top half of the int is ignored, this implementation appears to accept a Unicode codepoint which is output as a 4-byte UTF-8 sequence.
write in class java.io.Writerc - the char to be writtenjava.io.IOException - If an I/O error occurspublic void write(UnicodeString chars) throws java.io.IOException
write in interface UnicodeWriterchars - the characters to be processedjava.io.IOException - if processing fails for any reasonpublic void write(java.lang.String str)
throws java.io.IOException
UnicodeWriterwrite in interface UnicodeWriterwrite in class java.io.Writerstr - the characters to be processedjava.io.IOException - if processing fails for any reasonpublic void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.