Class SerializerHelper

java.lang.Object
org.apache.iceberg.flink.util.SerializerHelper
All Implemented Interfaces:
Serializable

@Internal public class SerializerHelper extends Object implements Serializable
Helper class to serialize and deserialize strings longer than 65K. The inspiration is mostly taken from the class org.apache.flink.core.memory.DataInputSerializer.readUTF and org.apache.flink.core.memory.DataOutputSerializer.writeUTF.
See Also:
  • Method Details

    • writeLongUTF

      public static void writeLongUTF(org.apache.flink.core.memory.DataOutputView out, String str) throws IOException
      Similar to DataOutputSerializer.writeUTF(String). Except this supports larger payloads which is up to max integer value.

      Note: This method can be removed when the method which does similar thing within the DataOutputSerializer already which does the same thing, so use that one instead once that is released on Flink version 1.20.

      See * FLINK-34228 * https://github.com/apache/flink/pull/24191

      Parameters:
      out - the output stream to write the string to.
      str - the string value to be written.
      Throws:
      IOException
    • readLongUTF

      public static String readLongUTF(org.apache.flink.core.memory.DataInputView in) throws IOException
      Similar to DataInputDeserializer.readUTF(). Except this supports larger payloads which is up to max integer value.

      Note: This method can be removed when the method which does similar thing within the DataOutputSerializer already which does the same thing, so use that one instead once that is released on Flink version 1.20.

      See * FLINK-34228 * https://github.com/apache/flink/pull/24191

      Parameters:
      in - the input stream to read the string from.
      Returns:
      the string value read from the input stream.
      Throws:
      IOException - if an I/O error occurs when reading from the input stream.