Class UnicodeWriterToWriter

  • All Implemented Interfaces:
    UnicodeWriter

    public class UnicodeWriterToWriter
    extends Object
    implements UnicodeWriter
    Implementation of UnicodeWriter that converts Unicode strings to ordinary Java strings and sends them to a supplied Writer
    • Constructor Detail

      • UnicodeWriterToWriter

        public UnicodeWriterToWriter​(Writer writer)
    • Method Detail

      • writeCodePoint

        public void writeCodePoint​(int codepoint)
                            throws IOException
        Process a single character. Default implementation wraps the codepoint into a single-character UnicodeString
        Specified by:
        writeCodePoint in interface UnicodeWriter
        Parameters:
        codepoint - the character to be processed. Must not be a surrogate
        Throws:
        IOException - if processing fails for any reason
      • write

        public void write​(String chars)
                   throws IOException
        Process a supplied string
        Specified by:
        write in interface UnicodeWriter
        Parameters:
        chars - the characters to be processed
        Throws:
        IOException - if processing fails for any reason
      • writeAscii

        public void writeAscii​(byte[] content)
                        throws IOException
        Write a supplied string known to consist entirely of ASCII characters, supplied as a byte array
        Specified by:
        writeAscii in interface UnicodeWriter
        Parameters:
        content - byte array holding ASCII characters only
        Throws:
        IOException - if processing fails for any reason
      • close

        public void close()
                   throws IOException
        Complete the writing of characters to the result.
        Specified by:
        close in interface UnicodeWriter
        Throws:
        IOException - if processing fails for any reason