getDataVarintOffset static method

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

Implementation

static int getDataVarintOffset(int bytes, {bool sign = false}) {
  if (bytes < 253) {
    return 1;
  }
  if (bytes == 253) {
    return 2;
  } else if (bytes == 254) {
    return 4;
  } else {
    return 8;
  }
}