static void writeServiceFile(Collection<String> services, OutputStream output)
      throws IOException {
    BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output, UTF_8));
    for (String service : services) {
      writer.write(service);
      writer.write('\n');
    }
    writer.flush();
  }
Writes the set of service class names to a service file.

@param output not {@code null}. Not closed after use.
@param services a not {@code null Collection} of service class names.
@throws IOException
service/processor/src/main/java/com/google/auto/service/processor/ServicesFiles.java