code: public static byte[] toBytes(short val) {
      byte[] b = new byte[SIZEOF_SHORT];
      b[1] = (byte) val;
      val >>= 8;
      b[0] = (byte) val;
      return b;
    }
docs: Convert a short value to a byte array of {@link #SIZEOF_SHORT} bytes long.
  @param val value
  @return the byte array