Class ApacheAvroSerializer
java.lang.Object
com.azure.core.serializer.avro.apache.ApacheAvroSerializer
- All Implemented Interfaces:
AvroSerializer
,ObjectSerializer
Apache Avro based implementation of the
AvroSerializer
interface.-
Method Summary
Modifier and TypeMethodDescription<T> T
deserialize
(InputStream stream, TypeReference<T> typeReference) Reads a stream into its object representation.<T> Mono<T>
deserializeAsync
(InputStream stream, TypeReference<T> typeReference) Reads a stream into its object representation.<T> T
deserializeFromBytes
(byte[] data, TypeReference<T> typeReference) Reads a byte array into its object representation.<T> Mono<T>
deserializeFromBytesAsync
(byte[] data, TypeReference<T> typeReference) Reads a byte array into its object representation.void
serialize
(OutputStream stream, Object value) Writes the serialized object into a stream.serializeAsync
(OutputStream stream, Object value) Writes the serialized object into a stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.core.experimental.serializer.AvroSerializer
serializeToBytes, serializeToBytesAsync
-
Method Details
-
deserializeFromBytes
Description copied from interface:ObjectSerializer
Reads a byte array into its object representation.- Specified by:
deserializeFromBytes
in interfaceAvroSerializer
- Specified by:
deserializeFromBytes
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
data
- Byte array.typeReference
-TypeReference
representing the object.- Returns:
- The object represented by the deserialized byte array.
-
deserialize
Description copied from interface:ObjectSerializer
Reads a stream into its object representation.- Specified by:
deserialize
in interfaceAvroSerializer
- Specified by:
deserialize
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
stream
-InputStream
of data.typeReference
-TypeReference
representing the object.- Returns:
- The object represented by the deserialized stream.
-
deserializeFromBytesAsync
Description copied from interface:ObjectSerializer
Reads a byte array into its object representation.- Specified by:
deserializeFromBytesAsync
in interfaceAvroSerializer
- Specified by:
deserializeFromBytesAsync
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
data
- Byte array.typeReference
-TypeReference
representing the object.- Returns:
- Reactive stream that emits the object represented by the deserialized byte array.
-
deserializeAsync
Description copied from interface:ObjectSerializer
Reads a stream into its object representation.- Specified by:
deserializeAsync
in interfaceAvroSerializer
- Specified by:
deserializeAsync
in interfaceObjectSerializer
- Type Parameters:
T
- Type of the object.- Parameters:
stream
-InputStream
of data.typeReference
-TypeReference
representing the object.- Returns:
- Reactive stream that emits the object represented by the deserialized stream.
-
serialize
Description copied from interface:ObjectSerializer
Writes the serialized object into a stream.- Specified by:
serialize
in interfaceAvroSerializer
- Specified by:
serialize
in interfaceObjectSerializer
- Parameters:
stream
-OutputStream
where the serialized object will be written.value
- The object.
-
serializeAsync
Description copied from interface:ObjectSerializer
Writes the serialized object into a stream.- Specified by:
serializeAsync
in interfaceAvroSerializer
- Specified by:
serializeAsync
in interfaceObjectSerializer
- Parameters:
stream
-OutputStream
where the serialized object will be written.value
- The object.- Returns:
- Reactive stream that will indicate operation completion.
-