public class TSerializer
extends java.lang.Object
Constructor and Description |
---|
TSerializer()
Create a new TSerializer that uses the TBinaryProtocol by default.
|
TSerializer(TProtocolFactory protocolFactory)
Create a new TSerializer.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
serialize(TBase base)
Serialize the Thrift object into a byte array.
|
java.lang.String |
toString(TBase base)
Serialize the Thrift object into a Java string, using the default JVM
charset encoding.
|
java.lang.String |
toString(TBase base,
java.lang.String charset)
Serialize the Thrift object into a Java string, using a specified
character set for encoding.
|
public TSerializer()
public TSerializer(TProtocolFactory protocolFactory)
protocolFactory
- Factory to create a protocolpublic byte[] serialize(TBase base) throws TException
base
- The object to serializeTException
public java.lang.String toString(TBase base, java.lang.String charset) throws TException
base
- The object to serializecharset
- Valid JVM charsetTException
public java.lang.String toString(TBase base) throws TException
base
- The object to serializeTException