split static method

List<Uint8List> split(
  1. Uint8List input,
  2. int firstLength,
  3. int secondLength,
  4. int thirdLength,
)

Implementation

static List<Uint8List> split(
    Uint8List input, int firstLength, int secondLength, int thirdLength) {
  if (firstLength < 0 ||
      secondLength < 0 ||
      thirdLength < 0 ||
      input.length < firstLength + secondLength + thirdLength) {
    throw Exception('Input too small: ${hex.encode(input)}');
  }
  final first = input.sublist(0, firstLength);
  final second = input.sublist(firstLength, firstLength + secondLength);
  final third = input.sublist(
      firstLength + secondLength, firstLength + secondLength + thirdLength);
  return [first, second, third];
}