Interface AvroSerializer

  • All Superinterfaces:
    ObjectSerializer

    public interface AvroSerializer
    extends ObjectSerializer
    Generic interface covering basic Avro serialization and deserialization methods.
    • Method Detail

      • deserializeFromBytes

        default <T> T deserializeFromBytes​(byte[] data,
                                           TypeReference<T> typeReference)
        Reads an Avro byte array into its object representation.
        Specified by:
        deserializeFromBytes in interface ObjectSerializer
        Type Parameters:
        T - Type of the object.
        Parameters:
        data - Avro byte array.
        typeReference - TypeReference representing the object.
        Returns:
        The object represented by the deserialized Avro byte array.
      • deserialize

        <T> T deserialize​(InputStream stream,
                          TypeReference<T> typeReference)
        Reads an Avro stream into its object representation.
        Specified by:
        deserialize in interface ObjectSerializer
        Type Parameters:
        T - Type of the object.
        Parameters:
        stream - Avro stream.
        typeReference - TypeReference representing the object.
        Returns:
        The object represented by the deserialized Avro stream.
      • deserializeFromBytesAsync

        default <T> Mono<T> deserializeFromBytesAsync​(byte[] data,
                                                      TypeReference<T> typeReference)
        Reads an Avro byte array into its object representation.
        Specified by:
        deserializeFromBytesAsync in interface ObjectSerializer
        Type Parameters:
        T - Type of the object.
        Parameters:
        data - Avro byte array.
        typeReference - TypeReference representing the object.
        Returns:
        Reactive stream that emits the object represented by the deserialized Avro byte array.
      • deserializeAsync

        <T> Mono<T> deserializeAsync​(InputStream stream,
                                     TypeReference<T> typeReference)
        Reads an Avro stream into its object representation.
        Specified by:
        deserializeAsync in interface ObjectSerializer
        Type Parameters:
        T - Type of the object.
        Parameters:
        stream - Avro stream.
        typeReference - TypeReference representing the object.
        Returns:
        Reactive stream that emits the object represented by the deserialized Avro stream.
      • serializeToBytes

        default byte[] serializeToBytes​(Object value)
        Converts the object into an Avro byte array.
        Specified by:
        serializeToBytes in interface ObjectSerializer
        Parameters:
        value - The object.
        Returns:
        The Avro binary representation of the serialized object.
      • serialize

        void serialize​(OutputStream stream,
                       Object value)
        Writes an object's Avro representation into a stream.
        Specified by:
        serialize in interface ObjectSerializer
        Parameters:
        stream - OutputStream where the object's Avro representation will be written.
        value - The object.
      • serializeToBytesAsync

        default Mono<byte[]> serializeToBytesAsync​(Object value)
        Converts the object into a Avro byte array.
        Specified by:
        serializeToBytesAsync in interface ObjectSerializer
        Parameters:
        value - The object.
        Returns:
        Reactive stream that emits the Avro binary representation of the serialized object.
      • serializeAsync

        Mono<Void> serializeAsync​(OutputStream stream,
                                  Object value)
        Writes an object's Avro representation into a stream.
        Specified by:
        serializeAsync in interface ObjectSerializer
        Parameters:
        stream - OutputStream where the object's Avro representation will be written.
        value - The object.
        Returns:
        Reactive stream that will indicate operation completion.