if (numFeatures >= 0 && index >= numFeatures)
                    throw new IndexOutOfBoundsException("Found " + (index+1) + " features in record, expected " + numFeatures);