extract static method

Uint8List? extract({
  1. required Uint8List origin,
  2. required int indexStart,
  3. required int length,
})

从字节序列中提取数据

Implementation

static Uint8List? extract(
    {required Uint8List origin,
    required int indexStart,
    required int length}) {
  if (indexStart >= origin.length) return null;
  int end = indexStart + length;
  if (end >= origin.length) {
    end = origin.length;
  }
  final sub = origin.sublist(indexStart, end);
  return sub;
}