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.
限定符 | 构造器和说明 |
---|---|
protected |
SerializedValue(byte[] serializedData) |
|
SerializedValue(T value)
Constructs a serialized value.
|
限定符和类型 | 方法和说明 |
---|---|
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
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–2022 The Apache Software Foundation. All rights reserved.