Here you can find the source of intToUnsignedShort(int value)
public static final byte[] intToUnsignedShort(int value) throws NumberFormatException
//package com.java2s; //License from project: Apache License public class Main { public static final byte[] intToUnsignedShort(int value) throws NumberFormatException { byte[] ret = new byte[2]; ret[0] = (byte) ((value & 0xff00) >>> 8); ret[1] = (byte) (value & 0xff); return ret; }/*from www. j a v a2 s .com*/ }