code: public static int writeShort(byte[] target, int offset, short value) {
          target[offset] = (byte) (value >>> 8 & 255);
          target[offset + 1] = (byte) (value & 255);
          return Short.BYTES;
      }
docs: Writes the given 16-bit Short to the given byte array at the given offset.
  
  @param target The byte array to write to.
  @param offset The offset within the byte array to write at.
  @param value  The value to write.
  @return The number of bytes written.