public void setBuffer(Type type, int components, Format format, Buffer buf) {
        VertexBuffer vb = buffers.get(type.ordinal());
        if (vb == null) {
            vb = new VertexBuffer(type);
            vb.setupData(Usage.Dynamic, components, format, buf);
            setBuffer(vb);
        } else {
            if (vb.getNumComponents() != components || vb.getFormat() != format) {
                throw new UnsupportedOperationException("The buffer already set "
                        + "is incompatible with the given parameters");
            }
            vb.updateData(buf);
            updateCounts();
        }
    }
Creates a {@link VertexBuffer} for the mesh or modifies
the existing one per the parameters given.

@param type The type of the buffer
@param components Number of components
@param format Data format
@param buf The buffer data

@throws UnsupportedOperationException If the buffer already set is
incompatible with the parameters given.
jme3-core/src/main/java/com/jme3/scene/Mesh.java