Here you can find the source of int2Word(int val)
public static byte[] int2Word(int val)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] int2Word(int val) { byte[] ret = new byte[2]; int firstByte = (0x0000FF00 & val) >> 8; int secondByte = (0x000000FF & val); ret[0] = (byte) firstByte; ret[1] = (byte) secondByte; return (ret); }//from w ww .j a v a 2 s . c o m }