public MetadataWriteFilter newInstance() {

        if (maxFieldSize < 0) {
            throw new IllegalArgumentException("maxFieldSize must be > 0");
        }

        if (maxValuesPerField < 1) {
            throw new IllegalArgumentException("maxValuesPerField must be > 0");
        }

        if (maxTotalEstimatedBytes < 0) {
            throw new IllegalArgumentException("max estimated size must be > 0");
        }

        return new StandardWriteFilter(maxKeySize, maxFieldSize,
                maxTotalEstimatedBytes, maxValuesPerField, includeFields,
                excludeFields, includeEmpty);
    }
Factory class for {@link StandardWriteFilter}. See that class
for how the estimated sizes are calculated on Strings.
tika-core/src/main/java/org/apache/tika/metadata/writefilter/StandardWriteFilterFactory.java