/** * Write a field whose value is a string array. * * The field will be written if required is true or the string array value is non-empty. * * @param fieldName is the name of the field. * @param value of the field. * @param required indicates whether this field will always be written * @throws IOException if there is an error writing. */ public void writeStringArrayField(String fieldName, List<String> value, boolean required) throws IOException { if (required || value.isEmpty() == false) { writeFieldName(fieldName); writeStringArray(value); } }