Here you can find the source of fromShort(short key)
public static byte[] fromShort(short key)
//package com.java2s; // BSD License (http://lemurproject.org/galago-license) public class Main { public static byte[] fromShort(short key) { byte[] writeBuffer = new byte[2]; writeBuffer[0] = (byte) ((key >>> 8) & 0xFF); writeBuffer[1] = (byte) key; return writeBuffer; }// w w w . j a v a 2s .c o m }