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 Details

    • CharOptimizedUTF8Encoder

      CharOptimizedUTF8Encoder()
  • Method Details

    • decode

      public String decode(byte[] encodedString, int offset, int length) throws 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:
      IOException - if something goes wrong