Here you can find the source of intToShort(int i)
public static Short intToShort(int i)
//package com.java2s; //License from project: LGPL public class Main { public static Short intToShort(int i) { if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return (short) i; }//www. j a v a2 s.c o m return null; } public static short intToShort(int i, short defaultValue) { if (i >= Short.MIN_VALUE && i <= Short.MAX_VALUE) { return (short) i; } return defaultValue; } }