Document remaining_data_len as in/out argument