Package net.sf.saxon.str
Interface UnicodeWriter
-
- All Known Implementing Classes:
UnicodeBuilder,UnicodeWriterToWriter,UTF8Writer
public interface UnicodeWriterInterface that accepts strings in the form ofUnicodeStringobjects, which are written to some destination. It also accepts ordinaryStringobjects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Complete the writing of characters to the result.default voidflush()Flush the contents of any buffers.voidwrite(java.lang.String chars)Process a supplied stringvoidwrite(UnicodeString chars)Process a supplied stringvoidwriteAscii(byte[] content)Write a supplied string known to consist entirely of ASCII characters, supplied as a byte array.default voidwriteCodePoint(int codepoint)Process a single character.default voidwriteRepeatedAscii(byte asciiChar, int count)Process a single character repeatedly.
-
-
-
Method Detail
-
write
void write(UnicodeString chars) throws java.io.IOException
Process a supplied string- Parameters:
chars- the characters to be processed- Throws:
java.io.IOException- if processing fails for any reason
-
writeAscii
void writeAscii(byte[] content) throws java.io.IOExceptionWrite a supplied string known to consist entirely of ASCII characters, supplied as a byte array. (The significance of this is that, for a variety of encodings including UTF-8 and Latin-1, the bytes can be written to the output stream "as is", because many encodings have ASCII as a subset.)- Parameters:
content- byte array holding ASCII characters only (the effect if the high-order bit is set is undefined)- Throws:
java.io.IOException- if processing fails for any reason
-
writeCodePoint
default void writeCodePoint(int codepoint) throws java.io.IOExceptionProcess a single character. The default implementation wraps the codepoint into a single-characterUnicodeString- Parameters:
codepoint- the character to be processed. Must not be a surrogate- Throws:
java.io.IOException- if processing fails for any reason
-
writeRepeatedAscii
default void writeRepeatedAscii(byte asciiChar, int count) throws java.io.IOExceptionProcess a single character repeatedly. The default implementation fills a byte array and callswriteAscii(byte[]).- Parameters:
asciiChar- the character to be processed.count- the number of times the character is to be output- Throws:
java.io.IOException- if processing fails for any reason
-
write
void write(java.lang.String chars) throws java.io.IOExceptionProcess a supplied string- Parameters:
chars- the characters to be processed- Throws:
java.io.IOException- if processing fails for any reason
-
close
default void close() throws java.io.IOExceptionComplete the writing of characters to the result. The default implementation does nothing.- Throws:
java.io.IOException- if processing fails for any reason
-
flush
default void flush() throws java.io.IOExceptionFlush the contents of any buffers. The default implementation does nothing.- Throws:
java.io.IOException- if processing fails for any reason
-
-