Java tutorial
//package com.java2s; public class Main { public static byte[] shortToByte(short number) { int temp = number; byte[] b = new byte[2]; for (int i = (b.length - 1); i >= 0; i--) { b[i] = new Integer(temp & 0xff).byteValue(); temp = temp >> 8; } return b; } }