Here you can find the source of reverse(final short[] pArray)
public static final void reverse(final short[] pArray)
//package com.java2s; public class Main { public static final void reverse(final byte[] pArray) { if (pArray == null) { return; }// w w w .j a va 2 s .co m int i = 0; int j = pArray.length - 1; byte tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final short[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; short tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final int[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; int tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final long[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; long tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final float[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; float tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final double[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; double tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } public static final void reverse(final Object[] pArray) { if (pArray == null) { return; } int i = 0; int j = pArray.length - 1; Object tmp; while (j > i) { tmp = pArray[j]; pArray[j] = pArray[i]; pArray[i] = tmp; j--; i++; } } }