available via default BitStore method
192681
static Number asNumber(BitStore store) {
		return new Number() {

			private static final long serialVersionUID = -2906430071162493968L;

			final int size = store.size();

			@Override
			public byte byteValue() {
				return (byte) store.getBits(0, Math.min(8, size));
			}

			@Override
			public short shortValue() {
				return (short) store.getBits(0, Math.min(16, size));
			}

			@Override
			public int intValue() {
				return (int) store.getBits(0, Math.min(32, size));
			}

			@Override
			public long longValue() {
				return store.getBits(0, Math.min(64, size));
			}

			@Override
			public float floatValue() {
				return store.toBigInteger().floatValue();
			}

			@Override
			public double doubleValue() {
				return store.toBigInteger().doubleValue();
			}

		};
	}
73071
private FedoraBinary getBinaryImplementation(final String extUrl) {
        String url = extUrl;
        if (url == null || url.isEmpty()) {
            url = getURLInfo();
        }

        if (url != null) {
            if (url.toLowerCase().startsWith(LOCAL_FILE_ACCESS_TYPE)) {
                return new LocalFileBinary(getNode());
            } else if (url.toLowerCase().startsWith(URL_ACCESS_TYPE)) {
                return new UrlBinary(getNode());
            }
        }

        return new InternalFedoraBinary(getNode());
    }
1142268
def native(self):
        

        if self.contents is None:
            return None

        if self._native is None:
            extra_bits = int_from_bytes(self.contents[0:1])
            # Fast path
            if not self._indefinite and extra_bits == 0:
                self._native = int_from_bytes(self.contents[1:])
            else:
                if self._indefinite and extra_bits > 0:
                    raise ValueError('Constructed bit string has extra bits on indefinite container')
                self._native = int(self._merge_chunks(), 2)
        return self._native
1022072
private BitSet toBitSet(int[] mapping) {
        BitSet hits = new BitSet();
        for (int v : mapping)
            hits.set(v);
        return hits;
    }
664839
def existingInStore(cls, store, storeID, attrs):
        """"""
        self = cls.__new__(cls)

        self.__justCreated = False
        self.__subinit__(__store=store,
                         storeID=storeID,
                         __everInserted=True)

        schema = self.getSchema()
        assert len(schema) == len(attrs), "invalid number of attributes"
        for data, (name, attr) in zip(attrs, schema):
            attr.loaded(self, data)
        self.activate()
        return self
355324
def read_bitpacked_deprecated(file_obj, byte_count, count, width, debug_logging):
    """"""
    raw_bytes = array.array(ARRAY_BYTE_STR, file_obj.read(byte_count)).tolist()

    mask = _mask_for_bits(width)
    index = 0
    res = []
    word = 0
    bits_in_word = 0
    while len(res) < count and index <= len(raw_bytes):
        if debug_logging:
            logger.debug("index = %d", index)
            logger.debug("bits in word = %d", bits_in_word)
            logger.debug("word = %s", bin(word))
        if bits_in_word >= width:
            # how many bits over the value is stored
            offset = (bits_in_word - width)

            # figure out the value
            value = (word & (mask << offset)) >> offset
            if debug_logging:
                logger.debug("offset = %d", offset)
                logger.debug("value = %d (%s)", value, bin(value))
            res.append(value)

            bits_in_word -= width
        else:
            word = (word << 8) | raw_bytes[index]
            index += 1
            bits_in_word += 8
    return res
550594
public void tstore(String name) throws IOException
    {
        TypeMirror cn = getLocalType(name);
        int index = getLocalVariableIndex(name);
        if (Typ.isPrimitive(cn))
        {
            tstore(cn, index);
        }
        else
        {
            astore(index);
        }
    }
431173
def get_bits need
    val = @bit_bucket
    while @bit_count < need
      val |= (@input_buffer[@in_pos+=1] << @bit_count)
      @bit_count += 8
    end

    @bit_bucket = val >> need
    @bit_count -= need
    val & ((1 << need) - 1)
  end
510560
def getStore(self) :
        """"""
        res = {}
        res.update(self.store)
        for k, v in self.subStores.items() :
            res[k] = v.getStore()
        
        return res
1195842
static Positions newPositions(Matches matches) {
		if (matches == null) throw new IllegalArgumentException("null matches");
		return new BitStorePositions(matches, false, 0);
	}
722882
@Override
	public BitStore range(int from, int to) {
		return store.range(from, to).immutableView();
	}
163639
function(storeName, transaction, cb) {
    try {
      return transaction.objectStore(storeName);
    } catch (err) {
      if (isFunction(cb)) return cb(err);
    }
  }
379402
static BitWriter newBitWriter(BitStore store, int finalPos, int initialPos) {
		return writerTo(store, Operation.SET, finalPos, initialPos);
	}
252786
def store(self, value, l, dir_only):
        """"""

        if l and value in (b'', ''):
            return

        globstar = value in (b'**', '**') and self.globstar
        magic = self.is_magic(value)
        if magic:
            value = compile(value, self.flags)
        l.append(WcGlob(value, magic, globstar, dir_only, False))
271892
static BitStore newRangedView(BitStore store, int from, int to) {
		if (store == null) throw new IllegalArgumentException("null store");
		if (from < 0) throw new IllegalArgumentException();
		if (from > to) throw new IllegalArgumentException();
		if (to > store.size()) throw new IllegalArgumentException();
		return new AbstractBitStore() {

			@Override
			public int size() {
				return to - from;
			}

			@Override
			public boolean getBit(int index) {
				return store.getBit(adjIndex(index));
			}

			@Override
			public void setBit(int index, boolean value) {
				store.setBit(adjIndex(index), value);
			}

			@Override
			public void flipBit(int index) {
				store.flipBit(adjIndex(index));
			}

			@Override
			public long getBits(int position, int length) {
				return store.getBits(adjPosition(position), length);
			}

			@Override
			public int getBitsAsInt(int position, int length) {
				return store.getBitsAsInt(adjPosition(position), length);
			}

			@Override
			public boolean getThenSetBit(int index, boolean value) {
				return store.getThenSetBit(adjIndex(index), value);
			}

			@Override
			public void setStore(int position, BitStore that) {
				store.setStore(adjPosition(position), that);
			}

			@Override
			public BitWriter openWriter() {
				return Bits.newBitWriter(store, from, to);
			}

			@Override
			public BitWriter openWriter(int finalPos, int initialPos) {
				return store.openWriter(adjPosition(finalPos), adjPosition(initialPos));
			}

			@Override
			public BitReader openReader() {
				return store.openReader(from, to);
			}

			@Override
			public BitReader openReader(int finalPos, int initialPos) {
				return store.openReader(adjPosition(finalPos), adjPosition(initialPos));
			}

			@Override
			public boolean isMutable() {
				return store.isMutable();
			}

			private int adjIndex(int index) {
				if (index < 0) throw new IllegalArgumentException("negative index");
				index += from;
				if (index >= to) throw new IllegalArgumentException("index too large");
				return index;
			}

			private int adjPosition(int position) {
				if (position < 0) throw new IllegalArgumentException("negative position");
				position += from;
				if (position > to) throw new IllegalArgumentException("position too large");
				return position;
			}
		};
	}
509516
static Positions newPositions(Matches matches, int position) {
		if (matches == null) throw new IllegalArgumentException("null matches");
		if (position < 0L) throw new IllegalArgumentException();
		//TODO consider restoring dedicated size accessor on matches
		if (position > matches.store().size()) throw new IllegalArgumentException();
		return new BitStorePositions(matches, false, position);
	}
678989
def native(self):
        

        # For BitString we default the value to be all zeros
        if self.contents is None:
            if self._map is None:
                self.set(())
            else:
                self.set(set())

        if self._native is None:
            bits = self._merge_chunks()
            if self._map:
                self._native = set()
                for index, bit in enumerate(bits):
                    if bit:
                        name = self._map.get(index, index)
                        self._native.add(name)
            else:
                self._native = bits
        return self._native