CarWriter constructor

CarWriter({
  1. required List<CID> roots,
  2. bool v2 = false,
  3. bool index = false,
  4. bool multihashIndex = false,
  5. int maxBlockSize = 32 * 1024 * 1024,
})

Creates a writer for a CAR archive with the given roots.

Set v2 to true to wrap the archive in a CAR v2 envelope. Set index to true to build an index (CAR v2 only).

Implementation

CarWriter({
  required this.roots,
  this.v2 = false,
  this.index = false,
  this.multihashIndex = false,
  this.maxBlockSize = 32 * 1024 * 1024,
}) {
  if (index && !v2) {
    throw ArgumentError('CAR index is only supported for CAR v2');
  }
}