Unverified Commit 29410abb authored by Mehmet Fidanboylu's avatar Mehmet Fidanboylu Committed by GitHub

Update the documentation on BinaryCodec (#19887)

Two clients have run into this in the past so adding a bit of documentation to make it clear. See https://github.com/flutter/flutter/issues/19849 for one example.
parent f2a983fc
...@@ -13,6 +13,10 @@ import 'message_codec.dart'; ...@@ -13,6 +13,10 @@ import 'message_codec.dart';
/// ///
/// On Android, messages will be represented using `java.nio.ByteBuffer`. /// On Android, messages will be represented using `java.nio.ByteBuffer`.
/// On iOS, messages will be represented using `NSData`. /// On iOS, messages will be represented using `NSData`.
///
/// When sending outgoing messages from Android, be sure to use direct `ByteBuffer`
/// as opposed to indirect. The `wrap()` API provides indirect buffers by default
/// and you will get empty `ByteData` objects in Dart.
class BinaryCodec implements MessageCodec<ByteData> { class BinaryCodec implements MessageCodec<ByteData> {
/// Creates a [MessageCodec] with unencoded binary messages represented using /// Creates a [MessageCodec] with unencoded binary messages represented using
/// [ByteData]. /// [ByteData].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment