public void updateData(Buffer data) {
        if (id != -1) {
            // request to update data is okay
        }

        // Check if the data buffer is read-only which is a sign
        // of a bug on the part of the caller
        if (data != null && data.isReadOnly()) {
            throw new IllegalArgumentException("VertexBuffer data cannot be read-only.");
        }

        // will force renderer to call glBufferData again
        if (data != null && (this.data.getClass() != data.getClass() || data.limit() != lastLimit)) {
            dataSizeChanged = true;
            lastLimit = data.limit();
        }

        this.data = data;
        setUpdateNeeded();
    }
Called to update the data in the buffer with new data. Can only
be called after {@link VertexBuffer#setupData(
com.jme3.scene.VertexBuffer.Usage, int, com.jme3.scene.VertexBuffer.Format, java.nio.Buffer) }
has been called. Note that it is fine to call this method on the
data already set, e.g. vb.updateData(vb.getData()), this will just
set the proper update flag indicating the data should be sent to the GPU
again.
<p>
It is allowed to specify a buffer with different capacity than the
originally set buffer, HOWEVER, if you do so, you must
call Mesh.updateCounts() otherwise bizarre errors can occur.

@param data The data buffer to set
jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java