Class StringUtf8Utils

java.lang.Object
org.apache.flink.table.runtime.util.StringUtf8Utils

public class StringUtf8Utils extends Object
String utf-8 utils.

StringUtf8Utils refers to the implementation from SerializeWriter and IOUtils of Alibaba fastjson. The difference is that StringUtf8Utils need to handle the wrong code, just like StringCoding.decode.

  • Constructor Details

    • StringUtf8Utils

      public StringUtf8Utils()
  • Method Details

    • encodeUTF8

      public static byte[] encodeUTF8(String str)
      This method must have the same result with JDK's String.getBytes.
    • encodeUTF8

      public static int encodeUTF8(String str, byte[] bytes)
    • defaultEncodeUTF8

      public static int defaultEncodeUTF8(String str, byte[] bytes)
    • decodeUTF8

      public static String decodeUTF8(byte[] input, int offset, int byteLen)
    • decodeUTF8Strict

      public static int decodeUTF8Strict(byte[] sa, int sp, int len, char[] da)
    • decodeUTF8

      public static String decodeUTF8(org.apache.flink.core.memory.MemorySegment input, int offset, int byteLen)
    • decodeUTF8Strict

      public static int decodeUTF8Strict(org.apache.flink.core.memory.MemorySegment segment, int sp, int len, char[] da)
    • defaultDecodeUTF8

      public static String defaultDecodeUTF8(byte[] bytes, int offset, int len)