Package io.ably.lib.objects
Interface ObjectsSerializer
public interface ObjectsSerializer
Serializer interface for converting between objects and their MessagePack or JSON representations.
- 
Method Summary
Modifier and TypeMethodDescription@NotNull com.google.gson.JsonArrayasJsonArray(@NotNull Object[] objects) Serializes the given Object array as a JSON array.@NotNull Object[]readFromJsonArray(@NotNull com.google.gson.JsonArray json) Reads a JSON array from the givenJsonArrayand deserializes it into an Object array.@NotNull Object[]readMsgpackArray(@NotNull org.msgpack.core.MessageUnpacker unpacker) Reads a MessagePack array from the given unpacker and deserializes it into an Object array.voidwriteMsgpackArray(@NotNull Object[] objects, @NotNull org.msgpack.core.MessagePacker packer) Serializes the given Object array as a MessagePack array using the provided packer. 
- 
Method Details
- 
readMsgpackArray
@NotNull @NotNull Object[] readMsgpackArray(@NotNull @NotNull org.msgpack.core.MessageUnpacker unpacker) throws IOException Reads a MessagePack array from the given unpacker and deserializes it into an Object array.- Parameters:
 - 
unpacker- the MessageUnpacker to read from - Returns:
 - the deserialized Object array
 - Throws:
 - 
IOException- if an I/O error occurs during unpacking 
 - 
writeMsgpackArray
void writeMsgpackArray(@NotNull @NotNull Object[] objects, @NotNull @NotNull org.msgpack.core.MessagePacker packer) throws IOException Serializes the given Object array as a MessagePack array using the provided packer.- Parameters:
 - 
objects- the Object array to serialize - 
packer- the MessagePacker to write to - Throws:
 - 
IOException- if an I/O error occurs during packing 
 - 
readFromJsonArray
Reads a JSON array from the givenJsonArrayand deserializes it into an Object array.- Parameters:
 - 
json- theJsonArrayrepresenting the array to deserialize - Returns:
 - the deserialized Object array
 
 - 
asJsonArray
Serializes the given Object array as a JSON array.- Parameters:
 - 
objects- the Object array to serialize - Returns:
 - the resulting JsonArray
 
 
 -