import struct


def _block_info(data):
    """Retrieve the information of the next block.

    The block ID is represented by an unsigned short while the block size is
    represented by a signed int.

    Parameters
    ----------
    data : bytes, length=6
        Data containing the block information

    Returns
    -------
    block_id : int
        The block ID.

    block_size :
        The size of the block.

    """
    # check that the data is an array of bytes
    if len(data) != 6:
        raise ValueError("'data' should be 6 bytes. Got {} instead.".format(
            len(data)))
    return struct.unpack('<Hi', data)