public static ShortBuffer createShortBuffer(int size) {
        ShortBuffer buf = allocator.allocate(2 * size).order(ByteOrder.nativeOrder()).asShortBuffer();
        buf.clear();
        onBufferAllocated(buf);
        return buf;
    }
Create a new ShortBuffer of the specified size.

@param size
           required number of shorts to store.
@return the new ShortBuffer
jme3-core/src/main/java/com/jme3/util/BufferUtils.java