def read_rle_bit_packed_hybrid(file_obj, width, length=None):
 debug_logging = logger.isEnabledFor(logging.DEBUG)
 io_obj = file_obj
 if (length is None):
  length = read_plain_int32(file_obj, 1)[0]
  raw_bytes = file_obj.read(length)
  if (raw_bytes == ''):
   return None
  io_obj = io.BytesIO(raw_bytes)
 res = []
 while (io_obj.tell() < length):
  header = read_unsigned_var_int(io_obj)
  if ((header & 1) == 0):
   res += read_rle(io_obj, header, width, debug_logging)
  else:
   res += read_bitpacked(io_obj, header, width, debug_logging)
 return res

def read_rle_bit_packed_hybrid ( file_obj , width , length = None ) : debug_logging = logger . isEnabledFor ( logging . DEBUG ) io_obj = file_obj if ( length is None ) : length = read_plain_int32 ( file_obj , 1 ) [ 0 ] raw_bytes = file_obj . read ( length ) if ( raw_bytes == '' ) : return None io_obj = io . BytesIO ( raw_bytes ) res = [ ] while ( io_obj . tell ( ) < length ) : header = read_unsigned_var_int ( io_obj ) if ( ( header & 1 ) == 0 ) : res += read_rle ( io_obj , header , width , debug_logging ) else : res += read_bitpacked ( io_obj , header , width , debug_logging ) return res
read values from fo using the rel/bit-packed hybrid encoding .