def convert_int_to_bits(int_value, index, size):
    """
    :param int_value: The integer value to convert to shifted bit representation.
    :param index: Start index of value in desired 4-byte output. Least significant bit of output is index zero.
    :param size: Size in bits that integer value should take up in returned data.
    :return: A 4-byte integer containing the int_value at the specified index.
    """
    if index < 0 or size < 1:
        raise RuntimeError("Index provided to convert_int_to_bits must be a positive value. Index: {0}".format(index))
    if size < 1:
        raise RuntimeError("Size provided to convert_int_to_bits must be non-zero. Size: {0}".format(size))
    if int_value > 2**size - 1:
        raise RuntimeError("Value provided to convert_int_to_bits cannot be represented in desired number of bits. Value: {0}, number of bits: {1}".format(int_value, size))
    num_bits = 32
    if index + size > num_bits:
        raise RuntimeError("Invalid values provided to convert_int_to_bits. Size + index must be less than or equal to 32.\nSize: {0} bits, index: {1}".format(size, index))
    return int_value << index