class Numbers {

    public static short safeCastIntToUnsignedShort( int value )
    {
        if ( (value & ~0xFFFF) != 0 )
        {
            throw new ArithmeticException( getOverflowMessage( value, "unsigned short" ) );
        }
        return (short) value;
    }

}