code: public static void saveSvgFile(final SVGGraphics2D graphics2d, final File path) throws IOException {
          try (FileOutputStream fs = new FileOutputStream(path);
               OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fs, StandardCharsets.UTF_8);
               Writer osw = new BufferedWriter(outputStreamWriter)
          ) {
              graphics2d.stream(osw, true);
          }
      }
docs: Save a SVG graphic to the given path.
  
  @param graphics2d The SVG graphic to save.
  @param path The file.