def METHOD_NAME(
    fp,
    proc_num,
    proc_index,
    index,
    header_row,
    offset,
    chunk_size,
    read_block_delimiter,
    writer,
):
    try:
        total_size = fp.size()
    except TypeError:
        total_size = fp.size
    part_size = (total_size - offset) // proc_num
    begin = part_size * proc_index + offset
    end = total_size if proc_index == proc_num - 1 else begin + part_size
    # See Note [Semantic of read_block with delimiter].
    if index == 0 and proc_index == 0:
        begin -= int(header_row)
    first_chunk = True
    while begin < end:
        buffer = read_block(
            fp,
            begin,
            min(chunk_size, end - begin),
            delimiter=read_block_delimiter,
        )
        if first_chunk:
            # strip the UTF-8 BOM
            if buffer[0:3] == b'\xef\xbb\xbf':
                buffer = buffer[3:]
        first_chunk = False
        size = len(buffer)
        if size <= 0:
            break
        begin += size
        if size > 0:
            chunk = writer.next(size)
            vineyard.memory_copy(chunk, 0, buffer)