Class CharOptimizedUTF8Encoder


  • final class CharOptimizedUTF8Encoder
    extends OptimizedUTF8Encoder
    UTF-8 encoder which validates input and is optimized for jdk 8 and lower where String objects are backed by char[].
    • Constructor Detail

      • CharOptimizedUTF8Encoder

        CharOptimizedUTF8Encoder()
    • Method Detail

      • decode

        public java.lang.String decode​(byte[] encodedString,
                                       int offset,
                                       int length)
                                throws java.io.IOException
        Decode an array of bytes into a string.
        Overrides:
        decode in class Encoding
        Parameters:
        encodedString - a byte array containing the string to decode
        offset - the offset in encodedString of the first byte of the encoded representation
        length - the length, in bytes, of the encoded representation
        Returns:
        the decoded string
        Throws:
        java.io.IOException - if something goes wrong