alignDownTo method

BigByteConverter alignDownTo(
  1. int alignment
)

Aligns down to the specified alignment.

Implementation

BigByteConverter alignDownTo(int alignment) {
  if (alignment <= 0) throw ArgumentError('Alignment must be positive');
  final bytes = _converter.bytes;
  final a = BigInt.from(alignment);
  final aligned = (bytes ~/ a) * a;
  return BigByteConverter(aligned);
}