Here you can find the source of longToInt(long l)
public static int longToInt(long l)
//package com.java2s; //License from project: Open Source License public class Main { public static int longToInt(long l) { if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) { throw new IllegalArgumentException(l + " cannot be cast to int"); }/* w w w . java2 s. c o m*/ return (int) l; } }