code: public static void shortToBytes(short value, byte[] bytes, int offset) {
          for (int i = offset + 1; i >= offset; --i) {
              bytes[i] = (byte) value;
              value = (short) ((value) >> 8);
          }
      }
docs: A utility method to convert a short into bytes in an array.
  
  @param value
  A short.
  @param bytes
  The byte array to which the short should be copied.
  @param offset
  The index where the short should start.