def parse_object_stream(obj_stream: Stream, env_num) -> tuple:
    """List objects embedded within an object stream (/ObjStm)."""
    res = []
    data = obj_stream['stream']
    offset = int(obj_stream['entries']['/First'])
    theorical_nb_obj = int(obj_stream['entries']['/N'])
    i = 0
    tokens = []
    while i < len(data):
        bo, eo, typ = next_token(data, i)
        tokens.append(bo)
        i = eo
    actual_nb_obj = len(tokens) // 3
    actual_offset = tokens[2 * actual_nb_obj]
    y_array = parse_obj(b'[' + data[:offset] + b']')
    y_pos = [y+offset for j, y in enumerate(y_array) if j % 2]
    for x in range(actual_nb_obj):
        actual_pos = tokens[2 * actual_nb_obj + x]
        o_num = parse_obj(data, tokens[2 * x])
        obj = parse_obj(data, actual_pos)
        theorical_pos = actual_pos if actual_pos in y_pos else None
        res.append((o_num, obj, env_num, theorical_pos, actual_pos))
    return (None, None, 'OBJSTREAM', res)
List objects embedded within an object stream (/ObjStm).
pdfsyntax/objects.py