MessageType
- the protocol buffer type to convertpublic class ProtocolBufferConverter<MessageType extends com.google.protobuf.Message> extends Object implements Converter<ByteBuffer>
Constructor and Description |
---|
ProtocolBufferConverter(MessageType instance)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
UserData<MessageType> |
deserialize(String wireSchema,
ByteBuffer buffer)
Deserializes the data from the wire.
|
ConverterSignature |
getSignature()
Get signature for this converter.
|
WireContents<ByteBuffer> |
serialize(Class<?> typeInfo,
Object obj)
Serializes user data to a wire representation.
|
public ProtocolBufferConverter(MessageType instance)
instance
- provide a default instance for the type to convertpublic WireContents<ByteBuffer> serialize(Class<?> typeInfo, Object obj) throws ConversionException
Converter
serialize
in interface Converter<ByteBuffer>
typeInfo
- Java class describing the type of the data to serializeobj
- data to serializeConversionException
- error converting the datapublic UserData<MessageType> deserialize(String wireSchema, ByteBuffer buffer) throws ConversionException
Converter
deserialize
in interface Converter<ByteBuffer>
wireSchema
- wire schema of the serialized databuffer
- serialized dataConversionException
- error deserializing from the wirepublic ConverterSignature getSignature()
Converter
getSignature
in interface Converter<ByteBuffer>
Copyright © 2018 CoR-Lab. All rights reserved.