public int updateVariableData(byte[] newData, int offset)
    {
        int vertexCount = getVertexCount();
        
        vertexIndexArray = new int[vertexCount];
        for (int index = 0; index < vertexIndexArray.length; ++index)
        {
            ByteConversions.setUnsignedShortInByteArrayAtPosition(vertexIndexArray[index], newData, offset);
            offset += 2;
        }

        xDisplacementArray = new short[vertexCount];
        for (int index = 0; index < xDisplacementArray.length; ++index)
        {
            ByteConversions.setShortInByteArrayAtPosition(xDisplacementArray[index], newData, offset);
            offset += 2;
        }

        yDisplacementArray = new short[vertexCount];
        for (int index = 0; index < yDisplacementArray.length; ++index)
        {
            ByteConversions.setShortInByteArrayAtPosition(yDisplacementArray[index], newData, offset);
            offset += 2;
        }

        zDisplacementArray = new short[vertexCount];
        for (int index = 0; index < zDisplacementArray.length; ++index)
        {
            ByteConversions.setShortInByteArrayAtPosition(zDisplacementArray[index], newData, offset);
            offset += 2;
        }

        uTextureArray = new short[vertexCount];
        for (int index = 0; index < uTextureArray.length; ++index)
        {
            ByteConversions.setShortInByteArrayAtPosition(uTextureArray[index], newData, offset);
            offset += 2;
        }

        vTextureArray = new short[vertexCount];
        for (int index = 0; index < vTextureArray.length; ++index)
        {
            ByteConversions.setShortInByteArrayAtPosition(vTextureArray[index], newData, offset);
            offset += 2;
        }

        return offset;
    }