T
- The type of the value held.@Internal public class SerializedValue<T> extends Object implements Serializable
ClassNotFoundException
.
To work around that issue, the SerializedValue serialized data immediately into a byte array. When send through RPC or another service that uses serialization, only the byte array is transferred. The object is deserialized later (upon access) and requires the accessor to provide the corresponding class loader.
Modifier | Constructor and Description |
---|---|
protected |
SerializedValue(byte[] serializedData) |
|
SerializedValue(T value)
Constructs a serialized value.
|
Modifier and Type | Method and Description |
---|---|
T |
deserializeValue(ClassLoader loader) |
boolean |
equals(Object obj) |
static <T> SerializedValue<T> |
fromBytes(byte[] serializedData)
Constructs serialized value from serialized data.
|
byte[] |
getByteArray()
Returns byte array for serialized data.
|
int |
hashCode() |
String |
toString() |
protected SerializedValue(byte[] serializedData)
public SerializedValue(T value) throws IOException
value
- value to serializeNullPointerException
- if value is nullIOException
- exception during serializationpublic T deserializeValue(ClassLoader loader) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public byte[] getByteArray()
public static <T> SerializedValue<T> fromBytes(byte[] serializedData)
T
- typeserializedData
- serialized dataNullPointerException
- if serialized data is nullIllegalArgumentException
- if serialized data is emptyCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.