public void setupData(Usage usage, int components, Format format, Buffer data) {
        if (id != -1) {
            throw new UnsupportedOperationException("Data has already been sent. Cannot setupData again.");
        }

        if (usage == null || format == null || data == null) {
            throw new IllegalArgumentException("None of the arguments can be null");
        }

        if (data.isReadOnly()) {
            throw new IllegalArgumentException("VertexBuffer data cannot be read-only.");
        }

        if (bufType != Type.InstanceData) {
            if (components < 1 || components > 4) {
                throw new IllegalArgumentException("components must be between 1 and 4");
            }
        }

        this.data = data;
        this.components = components;
        this.usage = usage;
        this.format = format;
        this.componentsLength = components * format.getComponentSize();
        this.lastLimit = data.limit();
        setUpdateNeeded();
    }
Called to initialize the data in the <code>VertexBuffer</code>. Must only
be called once.

@param usage The usage for the data, or how often will the data
be updated per frame. See the {@link Usage} enum.
@param components The number of components per element.
@param format The {@link Format format}, or data-type of a single
component.
@param data A native buffer, the format of which matches the {@link Format}
argument.
jme3-core/src/main/java/com/jme3/scene/VertexBuffer.java