/** * Returns a new direct short buffer. Allocates the buffer with capacity * equal to the length of the specified array, and copies all array * elements to the buffer. * @param a the array. * @return the new buffer. */ public static ShortBuffer newShortBuffer(short[] a) { ShortBuffer b = newShortBuffer(a.length); b.put(a); b.flip(); return b; } }