public static byte[] toBytes(short val) {
    byte[] b = new byte[SIZEOF_SHORT];
    b[1] = (byte) val;
    val >>= 8;
    b[0] = (byte) val;
    return b;
  }
Convert a short value to a byte array of {@link #SIZEOF_SHORT} bytes long.
@param val value
@return the byte array
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java