public final class BinaryCodec extends Object implements MessageCodec<ByteBuffer>
MessageCodec
using unencoded binary messages, represented as
ByteBuffer
s.
This codec is guaranteed to be compatible with the corresponding BinaryCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
On the Dart side, messages are represented using ByteData
.
Modifier and Type | Field and Description |
---|---|
static BinaryCodec |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
decodeMessage(ByteBuffer message)
Decodes the specified message from binary.
|
ByteBuffer |
encodeMessage(ByteBuffer message)
Encodes the specified message into binary.
|
public static final BinaryCodec INSTANCE
public ByteBuffer encodeMessage(ByteBuffer message)
MessageCodec
encodeMessage
in interface MessageCodec<ByteBuffer>
message
- the T message, possibly null.public ByteBuffer decodeMessage(ByteBuffer message)
MessageCodec
decodeMessage
in interface MessageCodec<ByteBuffer>
message
- the ByteBuffer
message, possibly null.