Converts this <code>ShortArray</code> to an array of shorts.

@return An array of shorts containing the same elements as this array.
339708
public short[] toShortArray() {
    short[] copy = new short[size];
    for (int i = 0; i < size; i++) {
      copy[i] = elements[i];
    }
    return copy;
  }
112204
public short[] getShorts(int rowId, int count) {
    short[] res = new short[count];
    for (int i = 0; i < count; i++) {
      res[i] = getShort(rowId + i);
    }
    return res;
  }
241674
public static short searchMax(short[] shortArray) {
        if(shortArray.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }

        short max = shortArray[0];

        for(int i = 1; i < shortArray.length; i++) {
            if(shortArray[i] > max) {
                max = shortArray[i];
            }
        }

        return max;
    }
591877
public static short[] ensureCapacity(short[] elements, int size) {
        if (size > elements.length) {
            short[] tmp = new short[size*2];
            System.arraycopy(elements, 0, tmp, 0, elements.length);
            elements = tmp;
        }
        return elements;
    }
879922
public char[] toCharArray() {
        final char[] b = new char[this.len];
        if (this.len > 0) {
            System.arraycopy(this.array, 0, b, 0, this.len);
        }
        return b;
    }
790767
public byte[] toArray() {
    byte[] copy = new byte[length];
    System.arraycopy(data, offset, copy, 0, length);
    return copy;
  }
940430
public int[] toIntegerArray() {
    int[] copy = new int[size];
    for (int i = 0; i < size; i++) {
      copy[i] = elements[i];
    }
    return copy;
  }
1318190
public byte[] toByteArray() {
    byte[] copy = new byte[size];
    for (int i = 0; i < size; i++) {
      copy[i] = elements[i];
    }
    return copy;
  }
1333876
public function shorts() {
		$out = array();
		foreach( $this->definedShortFlags as $key => $data ) {
			$out[$key] = $data[self::DEF_VALUE];
		}

		return $out;
	}
1154191
public short[] extractUCharArray() throws DevFailed {
	manageExceptions("extractUCharArray()");

	final byte[] argout = DevVarCharArrayHelper.extract(attrval.value);
	final short[] val = new short[argout.length];
	final short mask = 0xFF;
	for (int i = 0; i < argout.length; i++) {
	    val[i] = (short) (mask & argout[i]);
	}
	return val;
    }
295122
protected void fillArray(final short[] array) {
    int pos = 0;
    if (BufferUtil.isBackedBySimpleArray(bitmap)) {
      long[] b = bitmap.array();
      int base = 0;
      for (int k = 0; k < b.length; ++k) {
        long bitset = b[k];
        while (bitset != 0) {
          array[pos++] = (short) (base + numberOfTrailingZeros(bitset));
          bitset &= (bitset - 1);
        }
        base += 64;
      }

    } else {
      int len = this.bitmap.limit();
      int base = 0;
      for (int k = 0; k < len; ++k) {
        long bitset = bitmap.get(k);
        while (bitset != 0) {
          array[pos++] = (short) (base + numberOfLeadingZeros(bitset));
          bitset &= (bitset - 1);
        }
        base += 64;
      }
    }
  }
1264424
@SuppressWarnings("unchecked")
    @Override
    public final <AT> AT[] toArray(AT[] a) {
        this.readLock.lock();
        try {
            // Verify the array size
            if (a.length < this.size) {
                a =
                        (AT[])
                                java.lang.reflect.Array.newInstance(
                                        a.getClass().getComponentType(), this.size);
            }

            // Trick to avoid generics warning
            final Object[] result = a;

            // Copy over all elements
            int index = 0;
            for (final Queue<T> queue : this.keyedQueues.values()) {
                for (final T e : queue) {
                    result[index++] = e;
                }
            }

            // If array is too big set next element null
            if (a.length > this.size) {
                a[this.size] = null;
            }

            return a;
        } finally {
            this.readLock.unlock();
        }
    }
194894
public short read_short() throws OtpErlangDecodeException {
        final long l = this.read_long(false);
        final short i = (short) l;

        if (l != i) {
            throw new OtpErlangDecodeException("Value does not fit in short: "
                    + l);
        }

        return i;
    }
268964
String[] toArray() {
    String[] arr = new String[super.size()];
    Enumeration it = super.keys();
    int i = -1;
    while (it.hasMoreElements()) {
      String key = (String) it.nextElement();
      String val = (String) get(key);
      i++;
      arr[i] = key + "=" + val;
    }
    return arr;
  }
891099
public static short searchMin(short[] shortArray) {
        if(shortArray.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }

        short min = shortArray[0];

        for(int i = 1; i < shortArray.length; i++) {
            if(shortArray[i] < min) {
                min = shortArray[i];
            }
        }

        return min;
    }
98360
public static short[] shortArrayCopyOf(CollectionNumber coll) {
        short[] data = new short[coll.size()];
        IteratorNumber iter = coll.iterator();
        int index = 0;
        while (iter.hasNext()) {
            data[index] = iter.nextShort();
            index++;
        }
        return data;
    }
557774
public float[] toFloatArray() {
    float[] copy = new float[size];
    for (int i = 0; i < size; i++) {
      copy[i] = elements[i];
    }
    return copy;
  }