compressAsync function

Future<int> compressAsync(
  1. Pointer<Void> dst,
  2. int dstCapacity,
  3. Pointer<Void> src,
  4. int srcSize,
  5. int compressionLevel,
)

Implementation

Future<int> compressAsync(
  Pointer<Void> dst,
  int dstCapacity,
  Pointer<Void> src,
  int srcSize,
  int compressionLevel,
) async {
  final SendPort helperIsolateSendPort = await _helperIsolateSendPort;
  final int requestId = _nextCompressRequestId++;
  final _CompressRequest request = _CompressRequest(
      requestId, dst, dstCapacity, src, srcSize, compressionLevel);
  final Completer<int> completer = Completer<int>();
  _compressRequests[requestId] = completer;
  helperIsolateSendPort.send(request);
  return completer.future;
}