public int safeLongToInt(long l) {
	int i = (int)l;
	if ((long)i != l) {
		throw new IllegalArgumentException(l + " cannot be cast to int without changing its value.");
	}
	return i;
}
반응형
Posted by 질주하는구
,