code: public void writeAll(Writer writer, Collection<T> entities, boolean writeHeader) throws IOException {
  		checkEntityConfig();
  		BufferedWriter bufferedWriter = new BufferedWriter(writer);
  		try {
  			if (writeHeader) {
  				writeHeader(bufferedWriter, true);
  			}
  			for (T entity : entities) {
  				writeRow(bufferedWriter, entity, true);
  			}
  		} finally {
  			bufferedWriter.close();
  		}
  	}
docs: Write a header and then the collection of entities to the writer.
  
  @param writer
  Where to write the header and entities. It will be closed before this method returns.
  @param entities
  Collection of entities to write to the writer.
  @param writeHeader
  Set to true to write header at the start of the writer.
  @throws IOException
  If there are any IO exceptions thrown when writing.