process method

Uint8List process(
  1. Uint8List input
)

Implementation

Uint8List process(Uint8List input) {
  final numBlocks = input.length ~/ this.inputBlockSize + ((input.length % this.inputBlockSize != 0) ? 1 : 0);

  final output = Uint8List(numBlocks * this.outputBlockSize);

  var inputOffset = 0;
  var outputOffset = 0;
  while (inputOffset < input.length) {
    final chunkSize = (inputOffset + this.inputBlockSize <= input.length) ? this.inputBlockSize : input.length - inputOffset;

    outputOffset += this.processBlock(input, inputOffset, chunkSize, output, outputOffset);

    inputOffset += chunkSize;
  }

  return (output.length == outputOffset) ? output : output.sublist(0, outputOffset);
}