Package org.apache.iceberg.util
Class SerializationUtil
- java.lang.Object
-
- org.apache.iceberg.util.SerializationUtil
-
public class SerializationUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
deserializeFromBase64(java.lang.String base64)
static <T> T
deserializeFromBytes(byte[] bytes)
static java.lang.String
serializeToBase64(java.lang.Object obj)
static byte[]
serializeToBytes(java.lang.Object obj)
Serialize an object to bytes.static byte[]
serializeToBytes(java.lang.Object obj, java.util.function.Function<org.apache.hadoop.conf.Configuration,SerializableSupplier<org.apache.hadoop.conf.Configuration>> confSerializer)
Serialize an object to bytes.
-
-
-
Method Detail
-
serializeToBytes
public static byte[] serializeToBytes(java.lang.Object obj)
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(java.lang.Object obj, java.util.function.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
public static java.lang.String serializeToBase64(java.lang.Object obj)
-
deserializeFromBase64
public static <T> T deserializeFromBase64(java.lang.String base64)
-
-