getDataCompactOffset static method

int getDataCompactOffset(
  1. int bytes, {
  2. bool sign = false,
})

Implementation

static int getDataCompactOffset(int bytes, {bool sign = false}) {
  switch (bytes & 0x03) {
    case 0x00:
      return 1;
    case 0x01:
      return 2;
    case 0x02:
      return 4;
    default:
      return (bytes >> 2) + 5;
  }
}