public class TDeserializer
extends java.lang.Object
| Constructor and Description |
|---|
TDeserializer()
Create a new TDeserializer that uses the TBinaryProtocol by default.
|
TDeserializer(java.lang.Class<? extends TBase> thriftClass,
java.util.Collection<java.lang.String> fieldNames,
ThriftFieldValueProcessor processor,
TProtocolFactory protocolFactory)
Construct a new TDeserializer that supports partial deserialization
that outputs instances of type controlled by the given
processor. |
TDeserializer(java.lang.Class<? extends TBase> thriftClass,
java.util.Collection<java.lang.String> fieldNames,
TProtocolFactory protocolFactory)
Construct a new TDeserializer that supports partial deserialization
that outputs
TBase instances. |
TDeserializer(TProtocolFactory protocolFactory)
Create a new TDeserializer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deserialize(TBase base,
byte[] bytes)
Deserialize the Thrift object from a byte array.
|
void |
deserialize(TBase base,
byte[] bytes,
int offset,
int length)
Deserialize the Thrift object from a byte array.
|
void |
deserialize(TBase base,
java.lang.String data,
java.lang.String charset)
Deserialize the Thrift object from a Java string, using a specified
character set for decoding.
|
void |
fromString(TBase base,
java.lang.String data)
Deserialize the Thrift object from a Java string, using the default JVM
charset encoding.
|
ThriftMetadata.ThriftStruct |
getMetadata()
Gets the metadata used for partial deserialization.
|
void |
partialDeserialize(TBase tb,
byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only a single Thrift object (addressed by recursively using field id)
from a byte record.
|
java.lang.Boolean |
partialDeserializeBool(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only a boolean field (addressed by recursively using field id)
from a byte record.
|
java.lang.Byte |
partialDeserializeByte(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only a byte field (addressed by recursively using field id)
from a byte record.
|
java.nio.ByteBuffer |
partialDeserializeByteArray(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only a binary field (addressed by recursively using field id)
from a byte record.
|
java.lang.Double |
partialDeserializeDouble(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only a double field (addressed by recursively using field id)
from a byte record.
|
java.lang.Short |
partialDeserializeI16(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only an i16 field (addressed by recursively using field id)
from a byte record.
|
java.lang.Integer |
partialDeserializeI32(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only an i32 field (addressed by recursively using field id)
from a byte record.
|
java.lang.Long |
partialDeserializeI64(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only an i64 field (addressed by recursively using field id)
from a byte record.
|
java.lang.Object |
partialDeserializeObject(byte[] bytes)
Partially deserializes the given serialized blob.
|
java.lang.Object |
partialDeserializeObject(byte[] bytes,
int offset,
int length)
Partially deserializes the given serialized blob.
|
java.lang.Short |
partialDeserializeSetFieldIdInUnion(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only the id of the field set in a TUnion (addressed by recursively using field id)
from a byte record.
|
java.lang.String |
partialDeserializeString(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
Deserialize only a string field (addressed by recursively using field id)
from a byte record.
|
java.lang.Object |
partialDeserializeThriftObject(TBase base,
byte[] bytes,
int offset,
int length)
Partially deserializes the given serialized blob into the given
TBase instance. |
public TDeserializer()
throws TTransportException
TTransportException - if there an error initializing the underlying transport.public TDeserializer(TProtocolFactory protocolFactory) throws TTransportException
protocolFactory - Factory to create a protocolTTransportException - if there an error initializing the underlying transport.public TDeserializer(java.lang.Class<? extends TBase> thriftClass, java.util.Collection<java.lang.String> fieldNames, ThriftFieldValueProcessor processor, TProtocolFactory protocolFactory) throws TTransportException
processor.thriftClass - a TBase derived class.fieldNames - list of fields to deserialize.processor - the Processor that handles deserialized field values.protocolFactory - the Factory to create a protocol.TTransportExceptionpublic TDeserializer(java.lang.Class<? extends TBase> thriftClass, java.util.Collection<java.lang.String> fieldNames, TProtocolFactory protocolFactory) throws TTransportException
TBase instances.thriftClass - a TBase derived class.fieldNames - list of fields to deserialize.protocolFactory - the Factory to create a protocol.TTransportExceptionpublic ThriftMetadata.ThriftStruct getMetadata()
public void deserialize(TBase base, byte[] bytes) throws TException
base - The object to read intobytes - The array to read fromTException - if an error is encountered during deserialization.public void deserialize(TBase base, byte[] bytes, int offset, int length) throws TException
base - The object to read intobytes - The array to read fromoffset - The offset into byteslength - The length to read from bytesTException - if an error is encountered during deserialization.public void deserialize(TBase base, java.lang.String data, java.lang.String charset) throws TException
base - The object to read intodata - The string to read fromcharset - Valid JVM charsetTException - if an error is encountered during deserialization.public void partialDeserialize(TBase tb, byte[] bytes, TFieldIdEnum fieldIdPathFirst, TFieldIdEnum... fieldIdPathRest) throws TException
tb - The object to read intobytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path tbfieldIdPathRest - The rest FieldId's that define a path tbTException - if an error is encountered during deserialization.public java.lang.Boolean partialDeserializeBool(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to a boolean fieldfieldIdPathRest - The rest FieldId's that define a path to a boolean fieldTException - if an error is encountered during deserialization.public java.lang.Byte partialDeserializeByte(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to a byte fieldfieldIdPathRest - The rest FieldId's that define a path to a byte fieldTException - if an error is encountered during deserialization.public java.lang.Double partialDeserializeDouble(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to a double fieldfieldIdPathRest - The rest FieldId's that define a path to a double fieldTException - if an error is encountered during deserialization.public java.lang.Short partialDeserializeI16(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to an i16 fieldfieldIdPathRest - The rest FieldId's that define a path to an i16 fieldTException - if an error is encountered during deserialization.public java.lang.Integer partialDeserializeI32(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to an i32 fieldfieldIdPathRest - The rest FieldId's that define a path to an i32 fieldTException - if an error is encountered during deserialization.public java.lang.Long partialDeserializeI64(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to an i64 fieldfieldIdPathRest - The rest FieldId's that define a path to an i64 fieldTException - if an error is encountered during deserialization.public java.lang.String partialDeserializeString(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to a string fieldfieldIdPathRest - The rest FieldId's that define a path to a string fieldTException - if an error is encountered during deserialization.public java.nio.ByteBuffer partialDeserializeByteArray(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to a binary fieldfieldIdPathRest - The rest FieldId's that define a path to a binary fieldTException - if an error is encountered during deserialization.public java.lang.Short partialDeserializeSetFieldIdInUnion(byte[] bytes,
TFieldIdEnum fieldIdPathFirst,
TFieldIdEnum... fieldIdPathRest)
throws TException
bytes - The serialized object to read fromfieldIdPathFirst - First of the FieldId's that define a path to a TUnionfieldIdPathRest - The rest FieldId's that define a path to a TUnionTException - if an error is encountered during deserialization.public void fromString(TBase base, java.lang.String data) throws TException
base - The object to read intodata - The string to read fromTException - if an error is encountered during deserialization.public java.lang.Object partialDeserializeObject(byte[] bytes)
throws TException
bytes - the serialized blob.TException - if an error is encountered during deserialization.public java.lang.Object partialDeserializeThriftObject(TBase base, byte[] bytes, int offset, int length) throws TException
TBase instance.base - the instance into which the given blob is deserialized.bytes - the serialized blob.offset - the blob is read starting at this offset.length - the size of blob read (in number of bytes).TException - if an error is encountered during deserialization.public java.lang.Object partialDeserializeObject(byte[] bytes,
int offset,
int length)
throws TException
bytes - the serialized blob.offset - the blob is read starting at this offset.length - the size of blob read (in number of bytes).TException - if an error is encountered during deserialization.