Skip to content

Commit

Permalink
Uint8List(writeBytes) support to writeMapImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
David P committed May 27, 2020
1 parent 2d99682 commit eb0f65d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/cbor_encoder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ class Encoder {
}
// Encode the value
var valType = val.runtimeType.toString();
if (valType.contains('List')) {
if (valType.contains('List') && valType != 'Uint8List') {
valType = 'List';
}
if (valType.contains('Map')) {
Expand Down Expand Up @@ -712,6 +712,9 @@ class Encoder {
case 'Uint8Buffer':
_writeRawBuffer(val);
break;
case 'Uint8List':
_writeBytes(typed.Uint8Buffer()..addAll(val));
break;
default:
print('writeMapImpl::RT is ${val.runtimeType.toString()}');
ok = false;
Expand Down

0 comments on commit eb0f65d

Please sign in to comment.