Package net.sf.saxon.str
Class UnicodeWriterToWriter
- java.lang.Object
-
- net.sf.saxon.str.UnicodeWriterToWriter
-
- All Implemented Interfaces:
UnicodeWriter
public class UnicodeWriterToWriter extends java.lang.Object implements UnicodeWriter
Implementation ofUnicodeWriter
that converts Unicode strings to ordinary Java strings and sends them to a supplied Writer
-
-
Constructor Summary
Constructors Constructor Description UnicodeWriterToWriter(java.io.Writer writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Complete the writing of characters to the result.void
flush()
Flush the contents of any buffers.void
write(java.lang.String chars)
Process a supplied stringvoid
write(UnicodeString chars)
Process a supplied stringvoid
writeAscii(byte[] content)
Write a supplied string known to consist entirely of ASCII characters, supplied as a byte arrayvoid
writeCodePoint(int codepoint)
Process a single character.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.str.UnicodeWriter
writeRepeatedAscii
-
-
-
-
Method Detail
-
write
public void write(UnicodeString chars) throws java.io.IOException
Process a supplied string- Specified by:
write
in interfaceUnicodeWriter
- Parameters:
chars
- the characters to be processed- Throws:
java.io.IOException
- if processing fails for any reason
-
writeCodePoint
public void writeCodePoint(int codepoint) throws java.io.IOException
Process a single character. Default implementation wraps the codepoint into a single-characterUnicodeString
- Specified by:
writeCodePoint
in interfaceUnicodeWriter
- Parameters:
codepoint
- the character to be processed. Must not be a surrogate- Throws:
java.io.IOException
- if processing fails for any reason
-
write
public void write(java.lang.String chars) throws java.io.IOException
Process a supplied string- Specified by:
write
in interfaceUnicodeWriter
- Parameters:
chars
- the characters to be processed- Throws:
java.io.IOException
- if processing fails for any reason
-
writeAscii
public void writeAscii(byte[] content) throws java.io.IOException
Write a supplied string known to consist entirely of ASCII characters, supplied as a byte array- Specified by:
writeAscii
in interfaceUnicodeWriter
- Parameters:
content
- byte array holding ASCII characters only- Throws:
java.io.IOException
- if processing fails for any reason
-
close
public void close() throws java.io.IOException
Complete the writing of characters to the result.- Specified by:
close
in interfaceUnicodeWriter
- Throws:
java.io.IOException
- if processing fails for any reason
-
flush
public void flush() throws java.io.IOException
Flush the contents of any buffers.- Specified by:
flush
in interfaceUnicodeWriter
- Throws:
java.io.IOException
- if processing fails for any reason
-
-