public ByteBuffer getData() {
        if (regions.size() == 0) {
            if (data == null) data = BufferUtils.createByteBuffer(0);
        } else {
            int regionsEnd = regions.get(regions.size() - 1).getEnd();
            if (data == null) {
                data = BufferUtils.createByteBuffer(regionsEnd + 1);
            } else if (data.limit() < regionsEnd) {
                // new buffer
                ByteBuffer newData = BufferUtils.createByteBuffer(regionsEnd + 1);

                // copy old buffer in new buffer
                if (newData.limit() < data.limit()) data.limit(newData.limit());
                newData.put(data);

                // destroy old buffer
                BufferUtils.destroyDirectBuffer(data);

                data = newData;
            }
        }
        data.rewind();
        return data;
    }
Rewind and return buffer data

@return
jme3-core/src/main/java/com/jme3/shader/bufferobject/BufferObject.java