sbool getBit(byte[] b, int bit) { int idx = bit >> 3; if (idx < 0 || idx > l(b)) false; byte mask = cast 1 << (bit & 7); ret (b[idx] & mask) != 0; }