Package org.apache.iceberg.util
Class SerializationUtil
java.lang.Object
org.apache.iceberg.util.SerializationUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
deserializeFromBase64
(String base64) static <T> T
deserializeFromBytes
(byte[] bytes) static String
serializeToBase64
(Object obj) static byte[]
serializeToBytes
(Object obj) Serialize an object to bytes.static byte[]
serializeToBytes
(Object obj, Function<org.apache.hadoop.conf.Configuration, SerializableSupplier<org.apache.hadoop.conf.Configuration>> confSerializer) Serialize an object to bytes.
-
Method Details
-
serializeToBytes
Serialize an object to bytes. If the object implementsHadoopConfigurable
, its Hadoop configuration will be serialized into aSerializableConfiguration
.- Parameters:
obj
- object to serialize- Returns:
- serialized bytes
-
serializeToBytes
public static byte[] serializeToBytes(Object obj, Function<org.apache.hadoop.conf.Configuration, SerializableSupplier<org.apache.hadoop.conf.Configuration>> confSerializer) Serialize an object to bytes. If the object implementsHadoopConfigurable
, the confSerializer will be used to serialize Hadoop configuration used by the object.- Parameters:
obj
- object to serializeconfSerializer
- serializer for the Hadoop configuration- Returns:
- serialized bytes
-
deserializeFromBytes
public static <T> T deserializeFromBytes(byte[] bytes) -
serializeToBase64
-
deserializeFromBase64
-