Class UnicodeWriterToWriter

  • All Implemented Interfaces:
    UnicodeWriter

    public class UnicodeWriterToWriter
    extends java.lang.Object
    implements UnicodeWriter
    Implementation of UnicodeWriter 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 string
      void write​(UnicodeString chars)
      Process a supplied string
      void writeAscii​(byte[] content)
      Write a supplied string known to consist entirely of ASCII characters, supplied as a byte array
      void 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
    • Constructor Detail

      • UnicodeWriterToWriter

        public UnicodeWriterToWriter​(java.io.Writer writer)
    • Method Detail

      • write

        public void write​(UnicodeString chars)
                   throws java.io.IOException
        Process a supplied string
        Specified by:
        write in interface UnicodeWriter
        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-character UnicodeString
        Specified by:
        writeCodePoint in interface UnicodeWriter
        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 interface UnicodeWriter
        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 interface UnicodeWriter
        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 interface UnicodeWriter
        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 interface UnicodeWriter
        Throws:
        java.io.IOException - if processing fails for any reason