Class ProtobufWireFormatEncoder

java.lang.Object
com.amazonaws.services.schemaregistry.serializers.protobuf.ProtobufWireFormatEncoder

public class ProtobufWireFormatEncoder extends Object
Writes the wire format for Schema Registry embedded Protobuf messages.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    encode(@NonNull com.google.protobuf.Message message, com.google.protobuf.Descriptors.FileDescriptor schemaFileDescriptor)
    Encodes the message index as a zig-zag encoded variable size int into Byte stream.
    byte[]
    prefixMessageIndexToBytes(@lombok.NonNull byte[] bytesToEncode, com.google.protobuf.Descriptors.FileDescriptor schemaFileDescriptor, com.google.protobuf.Descriptors.Descriptor fileDescriptor)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProtobufWireFormatEncoder

      public ProtobufWireFormatEncoder()
  • Method Details

    • encode

      public byte[] encode(@NonNull @NonNull com.google.protobuf.Message message, @NonNull com.google.protobuf.Descriptors.FileDescriptor schemaFileDescriptor)
      Encodes the message index as a zig-zag encoded variable size int into Byte stream.
      Parameters:
      message - Protobuf message.
      schemaFileDescriptor - Protobuf schema file descriptor.
      Returns:
      Encoded protobuf message with message index.
    • prefixMessageIndexToBytes

      public byte[] prefixMessageIndexToBytes(@NonNull @lombok.NonNull byte[] bytesToEncode, @NonNull com.google.protobuf.Descriptors.FileDescriptor schemaFileDescriptor, @NonNull com.google.protobuf.Descriptors.Descriptor fileDescriptor) throws IOException
      Throws:
      IOException