def buffer_to_offset(buffer):
    """
    Convert a byte buffer into an integer offset according to ArcGIS packing
    scheme:

    (buffer[0] & 0xff) +
    (buffer[1] & 0xff) * 2 ** 8 +
    (buffer[2] & 0xff) * 2 ** 16 +
    (buffer[3] & 0xff) * 2 ** 24 ...

    Parameters
    ----------
    buffer: list[bytes]
        byte buffer

    Returns
    -------
    int: offset
    """

    return sum(((v & 0xFF) * 2 ** (i * 8) for i, v in enumerate(buffer)))