Class CoderHelpers
- java.lang.Object
-
- org.apache.beam.runners.spark.structuredstreaming.translation.helpers.CoderHelpers
-
public final class CoderHelpers extends java.lang.ObjectSerialization utility class.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TfromByteArray(byte[] serialized, org.apache.beam.sdk.coders.Coder<T> coder)Utility method for deserializing a byte array using the specified coder.static <T> byte[]toByteArray(T value, org.apache.beam.sdk.coders.Coder<T> coder)Utility method for serializing an object using the specified coder.
-
-
-
Method Detail
-
toByteArray
public static <T> byte[] toByteArray(T value, org.apache.beam.sdk.coders.Coder<T> coder)Utility method for serializing an object using the specified coder.- Type Parameters:
T- type of value that is serialized- Parameters:
value- Value to serialize.coder- Coder to serialize with.- Returns:
- Byte array representing serialized object.
-
fromByteArray
public static <T> T fromByteArray(byte[] serialized, org.apache.beam.sdk.coders.Coder<T> coder)Utility method for deserializing a byte array using the specified coder.- Type Parameters:
T- Type of object to be returned.- Parameters:
serialized- bytearray to be deserialized.coder- Coder to deserialize with.- Returns:
- Deserialized object.
-
-