Here you can find the source of long2short(long l)
public static short long2short(long l)
//package com.java2s; //License from project: Apache License public class Main { public static short long2short(long l) { return (short) (int) (l << 48 >> 48); }//w w w . j a v a 2 s.c o m }