take method
Implementation
Uint8List take(int count) {
_checkRange(count);
final Uint8List bytes;
if (count == _length) {
if (count == _data.length) {
bytes = _data;
_data = Uint8List(_defaultInitialCapacity);
} else {
bytes = Uint8List.fromList(Uint8List.sublistView(_data, 0, count));
}
_length = 0;
return bytes;
}
bytes = Uint8List.fromList(Uint8List.sublistView(_data, 0, count));
_dropLeading(count);
return bytes;
}