public interface MethodCodec
MethodCall
.
All operations throw IllegalArgumentException
, if conversion fails.Modifier and Type | Method and Description |
---|---|
Object |
decodeEnvelope(ByteBuffer envelope)
Decodes a result envelope from binary.
|
MethodCall |
decodeMethodCall(ByteBuffer methodCall)
Decodes a message call from binary.
|
ByteBuffer |
encodeErrorEnvelope(String errorCode,
String errorMessage,
Object errorDetails)
Encodes an error result into a binary envelope message.
|
ByteBuffer |
encodeMethodCall(MethodCall methodCall)
Encodes a message call into binary.
|
ByteBuffer |
encodeSuccessEnvelope(Object result)
Encodes a successful result into a binary envelope message.
|
ByteBuffer encodeMethodCall(MethodCall methodCall)
methodCall
- a MethodCall
.ByteBuffer
containing the encoding between position 0 and
the current position.MethodCall decodeMethodCall(ByteBuffer methodCall)
methodCall
- the binary encoding of the method call as a ByteBuffer
.MethodCall
representation of the bytes between the given buffer's current
position and its limit.ByteBuffer encodeSuccessEnvelope(Object result)
result
- The result value, possibly null.ByteBuffer
containing the encoding between position 0 and
the current position.ByteBuffer encodeErrorEnvelope(String errorCode, String errorMessage, Object errorDetails)
errorCode
- An error code String.errorMessage
- An error message String, possibly null.errorDetails
- Error details, possibly null.ByteBuffer
containing the encoding between position 0 and
the current position.Object decodeEnvelope(ByteBuffer envelope)
envelope
- the binary encoding of a result envelope as a ByteBuffer
.FlutterException
- if the envelope was an error envelope.