public static IntBuffer clone(IntBuffer buf) {
        if (buf == null) {
            return null;
        }
        buf.rewind();

        IntBuffer copy;
        if (isDirect(buf)) {
            copy = createIntBuffer(buf.limit());
        } else {
            copy = IntBuffer.allocate(buf.limit());
        }
        copy.put(buf);

        return copy;
    }
Creates a new IntBuffer with the same contents as the given IntBuffer.
The new IntBuffer is separate from the old one and changes are not
reflected across. If you want to reflect changes, consider using
Buffer.duplicate().

@param buf
           the IntBuffer to copy
@return the copy
jme3-core/src/main/java/com/jme3/util/BufferUtils.java