Package org.apache.iceberg.flink.util
Class SerializerHelper
java.lang.Object
org.apache.iceberg.flink.util.SerializerHelper
- All Implemented Interfaces:
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 Summary
Modifier and TypeMethodDescriptionstatic StringreadLongUTF(org.apache.flink.core.memory.DataInputView in) Similar toDataInputDeserializer.readUTF().static voidwriteLongUTF(org.apache.flink.core.memory.DataOutputView out, String str) Similar toDataOutputSerializer.writeUTF(String).
-
Method Details
-
writeLongUTF
public static void writeLongUTF(org.apache.flink.core.memory.DataOutputView out, String str) throws IOException Similar toDataOutputSerializer.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
DataOutputSerializeralready 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
Similar toDataInputDeserializer.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
DataOutputSerializeralready 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.
-