Class CharsetTranscoder

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void encode​(MarkupOutput mo, java.nio.CharBuffer charBuff)  
      void transcode​(MarkupOutput mo, java.lang.String decodeName, java.lang.String encodeName, byte[] data)
      Used to encode the data as the charset specified.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CharsetTranscoder

        public CharsetTranscoder()
    • Method Detail

      • encode

        public void encode​(MarkupOutput mo,
                           java.nio.CharBuffer charBuff)
                    throws java.nio.charset.CharacterCodingException
        Throws:
        java.nio.charset.CharacterCodingException
      • transcode

        public void transcode​(MarkupOutput mo,
                              java.lang.String decodeName,
                              java.lang.String encodeName,
                              byte[] data)
                       throws java.lang.IllegalArgumentException,
                              java.lang.IllegalStateException,
                              java.io.UnsupportedEncodingException
        Used to encode the data as the charset specified.
        By default it encodes using standard Java methods but can be overwritten for special cases.
        This method is only called if the charset requested is not "UnicodeLittle" as IServer sends the data in this charset.
        Specified by:
        transcode in interface ICharsetTranscoder
        Parameters:
        mo - The output object
        decodeName - the charset specified as supported by Java to decode the data
        encodeName - the charset to encode the data
        data - an array with the bytes as passed by IServer. These bytes are encoded using "UnicodeLittle".
        Throws:
        java.lang.IllegalArgumentException - if an error occurs when appending data to the markup output
        java.lang.IllegalStateException - if an error occurs when appending data to the markup output
        java.io.UnsupportedEncodingException - if an error occurs when appending data to the markup output