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(u'index = %d', index)
   logger.debug(u'bits in word = %d', bits_in_word)
   logger.debug(u'word = %s', bin(word))
  if (bits_in_word >= width):
   offset = (bits_in_word - width)
   value = ((word & (mask << offset)) >> offset)
   if debug_logging:
    logger.debug(u'offset = %d', offset)
    logger.debug(u'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

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 ( u'index = %d' , index ) logger . debug ( u'bits in word = %d' , bits_in_word ) logger . debug ( u'word = %s' , bin ( word ) ) if ( bits_in_word >= width ) : offset = ( bits_in_word - width ) value = ( ( word & ( mask << offset ) ) >> offset ) if debug_logging : logger . debug ( u'offset = %d' , offset ) logger . debug ( u'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
read count values from fo using the deprecated bitpacking encoding .