Package io.ably.lib.types
Class MessageSerializer
java.lang.Object
io.ably.lib.types.MessageSerializer
MessageReader: internal
Utility class to convert response bodies in different formats to Message
and Message arrays.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpCore.RequestBody
asJsonRequest
(Message message) JSON encodestatic HttpCore.RequestBody
asJsonRequest
(Message[] messages) static HttpCore.RequestBody
asJSONRequest
(Message.Batch[] pubSpecs) static HttpCore.RequestBody
asMsgpackRequest
(Message message) Msgpack encodestatic HttpCore.RequestBody
asMsgpackRequest
(Message[] messages) static HttpCore.RequestBody
asMsgpackRequest
(Message.Batch[] pubSpecs) static HttpCore.BodyHandler<Message>
BodyHandlerstatic Message[]
readMessagesFromJson
(byte[] packed) JSON decodestatic Message[]
readMsgpack
(byte[] packed) static Message[]
readMsgpackArray
(org.msgpack.core.MessageUnpacker unpacker) Msgpack decodereadStringMap
(org.msgpack.core.MessageUnpacker unpacker) static void
static byte[]
writeMsgpackArray
(Message[] messages) static void
writeMsgpackArray
(Message[] messages, org.msgpack.core.MessagePacker packer)
-
Constructor Details
-
MessageSerializer
public MessageSerializer()
-
-
Method Details
-
readMsgpackArray
public static Message[] readMsgpackArray(org.msgpack.core.MessageUnpacker unpacker) throws IOException Msgpack decode- Throws:
IOException
-
readMsgpack
- Throws:
AblyException
-
asMsgpackRequest
Msgpack encode- Throws:
AblyException
-
asMsgpackRequest
-
writeMsgpackArray
-
writeMsgpackArray
-
write
public static void write(Map<String, String> map, org.msgpack.core.MessagePacker packer) throws IOException- Throws:
IOException
-
readStringMap
public static Map<String,String> readStringMap(org.msgpack.core.MessageUnpacker unpacker) throws IOException - Throws:
IOException
-
asMsgpackRequest
-
readMessagesFromJson
JSON decode- Throws:
MessageDecodeException
-
asJsonRequest
JSON encode- Throws:
AblyException
-
asJsonRequest
-
asJSONRequest
-
getMessageResponseHandler
BodyHandler
-