reverse method

void reverse(
  1. int numOfBytes
)

Implementation

void reverse(int numOfBytes) {
  void swap(int x, int y) {
    var t = byteList[x + offset];
    byteList[x + offset] = byteList[y + offset];
    byteList[y + offset] = t;
  }

  for (var i = 0; i <= (numOfBytes - 1) % 2; i++) {
    swap(i, numOfBytes - 1 - i);
  }
}