public static byte[] convertToBytes(short value) {
        byte[] byteArray = new byte[2];

        byteArray[0] = (byte) (value >> 8);
        byteArray[1] = (byte) value;
        return byteArray;
    }
Writes a short out to an OutputStream.

@param outputStream
           The OutputStream the short will be written to
@param value
           The short to write
@throws IOException
            Thrown if there is a problem writing to the OutputStream
jme3-core/src/plugins/java/com/jme3/export/binary/ByteUtils.java