messagepack icon indicating copy to clipboard operation
messagepack copied to clipboard

Add packUint8List() and unpackUint8List() methods

Open claudiofelber opened this issue 3 years ago • 1 comments

Thank you for providing this useful package.

Would you mind adding a packUint8List and unpackUint8List method? The reason for this being, that Uint8List is often used in Dart and Flutter (e.g. in StandardMessageCodec). And while Uint8List can be freely cast to List<int>, doing the reverse with Uint8List.fromList comes at a cost.

Maybe, since the package has not yet reached version 1.0 and a breaking change might be justifiable, this could even be rewritten as packBinary and unpackBinary (replacing the current List<int>-based implementation).

claudiofelber avatar Jul 12 '21 10:07 claudiofelber

I also think that (un)?packBinary should be taking/returning Uint8List to avoid the overhead of converting other types of lists to Uint8List.

petoknm avatar Jul 30 '21 09:07 petoknm