public class ThriftMessageUtil extends Object
Constructor and Description |
---|
ThriftMessageUtil() |
ThriftMessageUtil(int initialCapacity,
double growthCoefficient) |
Modifier and Type | Method and Description |
---|---|
<T extends org.apache.thrift.TBase<?,?>> |
deserialize(byte[] serialized,
int offset,
int length,
T instance)
Deserializes a message into the provided
instance from serialized |
<T extends org.apache.thrift.TBase<?,?>> |
deserialize(byte[] serialized,
T instance)
Assumes the entire contents of the byte array compose the serialized
instance |
ByteBuffer |
serialize(org.apache.thrift.TBase<?,?> msg)
Convert the
msg to a byte array representation |
public ThriftMessageUtil()
public ThriftMessageUtil(int initialCapacity, double growthCoefficient)
public ByteBuffer serialize(org.apache.thrift.TBase<?,?> msg) throws IOException
msg
to a byte array representationmsg
- The message to serializeIOException
- When serialization failspublic <T extends org.apache.thrift.TBase<?,?>> T deserialize(byte[] serialized, T instance) throws IOException
instance
IOException
deserialize(byte[], int, int, TBase)
public <T extends org.apache.thrift.TBase<?,?>> T deserialize(byte[] serialized, int offset, int length, T instance) throws IOException
instance
from serialized
serialized
- The serialized representation of the objectinstance
- An instance of the object to reconstituteIOException
- When deserialization failsCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.