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.
This commit is contained in:
Mehmet Fidanboylu 2018-07-27 22:10:39 -07:00 committed by GitHub
parent f2a983fc21
commit 29410abbe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,10 @@ import 'message_codec.dart';
///
/// On Android, messages will be represented using `java.nio.ByteBuffer`.
/// 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> {
/// Creates a [MessageCodec] with unencoded binary messages represented using
/// [ByteData].