Package com.azure.core.util.serializer
Interface ObjectSerializer
- All Known Subinterfaces:
JsonSerializer
public interface ObjectSerializer
Generic interface covering serializing and deserialization objects.
-
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(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.default <T> TdeserializeFromBytes(byte[] data, TypeReference<T> typeReference) Reads a byte array into its object representation.default <T> Mono<T> deserializeFromBytesAsync(byte[] data, TypeReference<T> typeReference) Reads a byte array into its object representation.voidserialize(OutputStream stream, Object value) Writes the serialized object into a stream.serializeAsync(OutputStream stream, Object value) Writes the serialized object into a stream.default byte[]serializeToBytes(Object value) Converts the object into a byte array.default Mono<byte[]> serializeToBytesAsync(Object value) Converts the object into a byte array.
-
Method Details
-
deserializeFromBytes
Reads a byte array into its object representation.- Type Parameters:
T- Type of the object.- Parameters:
data- Byte array.typeReference-TypeReferencerepresenting the object.- Returns:
- The object represented by the deserialized byte array.
-
deserialize
Reads a stream into its object representation.- Type Parameters:
T- Type of the object.- Parameters:
stream-InputStreamof data.typeReference-TypeReferencerepresenting the object.- Returns:
- The object represented by the deserialized stream.
-
deserializeFromBytesAsync
Reads a byte array into its object representation.- Type Parameters:
T- Type of the object.- Parameters:
data- Byte array.typeReference-TypeReferencerepresenting the object.- Returns:
- Reactive stream that emits the object represented by the deserialized byte array.
-
deserializeAsync
Reads a stream into its object representation.- Type Parameters:
T- Type of the object.- Parameters:
stream-InputStreamof data.typeReference-TypeReferencerepresenting the object.- Returns:
- Reactive stream that emits the object represented by the deserialized stream.
-
serializeToBytes
Converts the object into a byte array.- Parameters:
value- The object.- Returns:
- The binary representation of the serialized object.
-
serialize
Writes the serialized object into a stream.- Parameters:
stream-OutputStreamwhere the serialized object will be written.value- The object.
-
serializeToBytesAsync
Converts the object into a byte array.- Parameters:
value- The object.- Returns:
- Reactive stream that emits the binary representation of the serialized object.
-
serializeAsync
Writes the serialized object into a stream.- Parameters:
stream-OutputStreamwhere the serialized object will be written.value- The object.- Returns:
- Reactive stream that will indicate operation completion.
-