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