Class ProtobufSerializer

  • All Implemented Interfaces:
    Serializer

    public class ProtobufSerializer
    extends Object
    This Serializer (de)serializes Message objects.
    • Constructor Detail

      • ProtobufSerializer

        public ProtobufSerializer()
    • Method Detail

      • matchedToByArray

        protected byte[] matchedToByArray​(com.google.protobuf.Message o)
      • matchedFromByteArray

        protected com.google.protobuf.Message matchedFromByteArray​(byte[] bytes,
                                                                   Class<com.google.protobuf.Message> type)
                                                            throws IOException
        Throws:
        IOException
      • fromByteArray

        public <T> T fromByteArray​(byte[] bytes,
                                   Class<T> type)
                            throws IOException
        Description copied from interface: Serializer
        Produces an object of type T from an array of bytes.
        Specified by:
        fromByteArray in interface Serializer
        Throws:
        IOException - if serialization to byte array fails