flush method

Uint8List flush()

Flush the encoder, returning any remaining MP3 data.

Implementation

Uint8List flush() {
  _checkNotDisposed();

  final outSizePtr = calloc<Int32>();
  final result = _glintFlush(_handle, outSizePtr);
  final outSize = outSizePtr.value;

  Uint8List output;
  if (result == nullptr || outSize <= 0) {
    output = Uint8List(0);
  } else {
    output = Uint8List.fromList(result.asTypedList(outSize));
  }

  calloc.free(outSizePtr);
  return output;
}