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 = 0; i < b.length; i++) { b[i] = new Integer(temp & 0xff).byteValue(); temp = temp >> 8; } return b; } }