def int_to_bytearray(value: int, num_byte: int) -> bytearray:
    """
    Convert a long integer to a 'bytearray' object.

    Args:
        value: The long integer value to convert.
        num_byte: Number of bytes in the 'bytearray' object.

    Returns:
        The 'bytearray' object from long integer value.
    """
    return bytearray(
        [(value & (0xff << pos * 8)) >> pos * 8 for pos in range(num_byte - 1, -1, -1)]
    )