def dump_uint_b_into(n, width, buffer, offset=0):
    """
    Serializes fixed size integer to the buffer
    :param n:
    :param width:
    :return:
    """
    for idx in range(width):
        buffer[idx + offset] = n & 0xff
        n >>= 8
    return buffer