def build_revision_byte_stream(
        changes: list, current_index: list, cache: list,
        starting_pos: int, xref_stream_num: int) -> tuple:
    """List the sequence of byte blocks that make the update."""
    fragments = []
    xref_table = []
    res = b''
    new_index = deepcopy(current_index)
    counter = starting_pos + len(MARGIN)
    fragments.append(MARGIN)
    next_free = circular_deleted(changes)
    l = [(0j, 'd')] + changes
    for c, action in l:
        num = int(c.imag)
        o_gen = current_index[num]['o_gen']
        env_num = current_index[num].get('env_num')
        if action != 'd' and env_num:
            new_env = append_to_stream_fragment(num, cache[num], cache[env_num])
            cache[env_num] = new_env
            xref_table.append(('n', num, o_gen, get_pos_in_stream(new_env), env_num))
    for c, action in l:
        num = int(c.imag)
        if action == 'd':
            if num == 0:
                o_gen = 65535 - 1
            else:
                o_gen = current_index[num]['o_gen']
            xref_table.append(('f', num, o_gen, None, None))
        else:
            o_gen = current_index[num]['o_gen']
            env_num = current_index[num].get('env_num')
            if not env_num:
                obj = cache[num]
                if type(obj) == Stream and obj['entries'].get('/Type') == '/ObjStm':
                    obj = finalize_stream(obj)
                block = serialize_fragment(num, o_gen, obj)
                fragments.append(block)
                xref_table.append(('n', num, o_gen, counter, env_num))
                new_index[num]['abs_pos'] = counter
                new_index[num]['abs_next'] = counter + len(block)
                counter += len(block)
    xref_table.sort(key=lambda xr: xr[1])
    if not xref_stream_num:
        #cache[0]['/Size'] = len(current_index)
        built_xref = format_xref_table(xref_table, cache[0], next_free)
        new_index[0]['xref_table_pos'] = counter
        new_index[0]['abs_pos'] = counter + built_xref.rfind(b'trailer')
        new_index[0]['abs_next'] = counter + len(built_xref)
    else:
        xref_table.append(('n', xref_stream_num, 0, counter, None))
        built_xref = format_xref_stream(xref_table, cache[0], next_free, xref_stream_num)
        new_index[xref_stream_num]['abs_pos'] = counter
        new_index[xref_stream_num]['abs_next'] = counter + len(block)
        new_index[0]['xref_stream_pos'] = counter
        new_index[0]['abs_pos'] = counter
        new_index[0]['abs_next'] = counter + len(built_xref)
    fragments.append(built_xref)
    fragments.append(f'startxref\n{counter}\n'.encode('ascii'))
    fragments.append(b'%%EOF\n')
    for i in fragments:
        res += i
    return res, new_index
List the sequence of byte blocks that make the update.
pdfsyntax/filestruct.py