Flutter Engine
The Flutter Engine
|
Public Member Functions | |
ByteBuffer | encodeMethodCall (@NonNull MethodCall methodCall) |
MethodCall | decodeMethodCall (@NonNull ByteBuffer methodCall) |
ByteBuffer | encodeSuccessEnvelope (@Nullable Object result) |
ByteBuffer | encodeErrorEnvelope ( @NonNull String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails) |
ByteBuffer | encodeErrorEnvelopeWithStacktrace ( @NonNull String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails, @Nullable String errorStacktrace) |
Object | decodeEnvelope (@NonNull ByteBuffer envelope) |
A codec for method calls and enveloped results.
Method calls are encoded as binary messages with enough structure that the codec can extract a method name String and an arguments Object. These data items are used to populate a MethodCall
.
All operations throw IllegalArgumentException
, if conversion fails.
Definition at line 20 of file MethodCodec.java.
Object io.flutter.plugin.common.MethodCodec.decodeEnvelope | ( | @NonNull ByteBuffer | envelope | ) |
Decodes a result envelope from binary.
envelope | the binary encoding of a result envelope as a ByteBuffer . |
FlutterException | if the envelope was an error envelope. |
Implemented in io.flutter.plugin.common.JSONMethodCodec, and io.flutter.plugin.common.StandardMethodCodec.
MethodCall io.flutter.plugin.common.MethodCodec.decodeMethodCall | ( | @NonNull ByteBuffer | methodCall | ) |
Decodes a message call from binary.
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. Implemented in io.flutter.plugin.common.JSONMethodCodec, and io.flutter.plugin.common.StandardMethodCodec.
ByteBuffer io.flutter.plugin.common.MethodCodec.encodeErrorEnvelope | ( | @NonNull String | errorCode, |
@Nullable String | errorMessage, | ||
@Nullable Object | errorDetails | ||
) |
Encodes an error result into a binary envelope message.
errorCode | An error code String. |
errorMessage | An error message String, possibly null. |
errorDetails | Error details, possibly null. Consider supporting Throwable in your codec. This is the most common value passed to this field. |
ByteBuffer
containing the encoding between position 0 and the current position. Implemented in io.flutter.plugin.common.JSONMethodCodec.
ByteBuffer io.flutter.plugin.common.MethodCodec.encodeErrorEnvelopeWithStacktrace | ( | @NonNull String | errorCode, |
@Nullable String | errorMessage, | ||
@Nullable Object | errorDetails, | ||
@Nullable String | errorStacktrace | ||
) |
Encodes an error result into a binary envelope message with the native stacktrace.
errorCode | An error code String. |
errorMessage | An error message String, possibly null. |
errorDetails | Error details, possibly null. Consider supporting Throwable in your codec. This is the most common value passed to this field. |
errorStacktrace | Platform stacktrace for the error. possibly null. |
ByteBuffer
containing the encoding between position 0 and the current position. Implemented in io.flutter.plugin.common.JSONMethodCodec.
ByteBuffer io.flutter.plugin.common.MethodCodec.encodeMethodCall | ( | @NonNull MethodCall | methodCall | ) |
Encodes a message call into binary.
methodCall | a MethodCall . |
ByteBuffer
containing the encoding between position 0 and the current position. Implemented in io.flutter.plugin.common.JSONMethodCodec, and io.flutter.plugin.common.StandardMethodCodec.
ByteBuffer io.flutter.plugin.common.MethodCodec.encodeSuccessEnvelope | ( | @Nullable Object | result | ) |
Encodes a successful result into a binary envelope message.
result | The result value, possibly null. |
ByteBuffer
containing the encoding between position 0 and the current position. Implemented in io.flutter.plugin.common.JSONMethodCodec.