extractNumericFromBitArray static method

int extractNumericFromBitArray(
  1. BitArray information,
  2. int pos,
  3. int bits
)

Implementation

static int extractNumericFromBitArray(
  BitArray information,
  int pos,
  int bits,
) {
  int value = 0;
  for (int i = 0; i < bits; ++i) {
    if (information.get(pos + i)) {
      value |= 1 << (bits - i - 1);
    }
  }

  return value;
}