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

        ShortBuffer copy;
        if (isDirect(buf)) {
            copy = createShortBuffer(buf.limit());
        } else {
            copy = ShortBuffer.allocate(buf.limit());
        }
        copy.put(buf);

        return copy;
    }
Creates a new ShortBuffer with the same contents as the given
ShortBuffer. The new ShortBuffer 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 ShortBuffer to copy
@return the copy
jme3-core/src/main/java/com/jme3/util/BufferUtils.java