Interface AvroSerializer
-
- All Superinterfaces:
ObjectSerializer
public interface AvroSerializer extends ObjectSerializer
Generic interface covering basic Avro serialization and deserialization methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> T
deserialize(InputStream stream, TypeReference<T> typeReference)
Reads an Avro stream into its object representation.<T> Mono<T>
deserializeAsync(InputStream stream, TypeReference<T> typeReference)
Reads an Avro stream into its object representation.default <T> T
deserializeFromBytes(byte[] data, TypeReference<T> typeReference)
Reads an Avro byte array into its object representation.default <T> Mono<T>
deserializeFromBytesAsync(byte[] data, TypeReference<T> typeReference)
Reads an Avro byte array into its object representation.void
serialize(OutputStream stream, Object value)
Writes an object's Avro representation into a stream.Mono<Void>
serializeAsync(OutputStream stream, Object value)
Writes an object's Avro representation into a stream.default byte[]
serializeToBytes(Object value)
Converts the object into an Avro byte array.default Mono<byte[]>
serializeToBytesAsync(Object value)
Converts the object into a Avro byte array.
-
-
-
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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- 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 interfaceObjectSerializer
- Parameters:
stream
-OutputStream
where the object's Avro representation will be written.value
- The object.- Returns:
- Reactive stream that will indicate operation completion.
-
-