// Path: jdcallgraph/src/test/java/com/dkarv/jdcallgraph/helper/TestUtils.java
// public class TestUtils {
//   public static File writeFile(final TemporaryFolder tmp, String... content) throws IOException {
//     File configFile = tmp.newFile();
//     PrintWriter out = new PrintWriter(configFile, "UTF-8");
//     for (String line : content) {
//       out.println(line);
//     }
//     out.close();
//     return configFile;
//   }
// 
//   public static String readFile(final TemporaryFolder tmp, String fileName) throws IOException {
//     byte[] encoded = Files.readAllBytes(Paths.get(tmp.getRoot().getCanonicalPath(), fileName));
//     return new String(encoded, StandardCharsets.UTF_8);
//   }
// 
//   /**
//    * Clear/Empty a file.
//    */
//   public static void clear(TemporaryFolder tmp, String fileName) throws FileNotFoundException {
//     (new PrintWriter(new File(tmp.getRoot(), fileName))).close();
//   }
// 
//   public static InputStream writeInputStream(String content) throws UnsupportedEncodingException {
//     return new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8.name()));
//   }
// }


import com.dkarv.jdcallgraph.helper.TestUtils;
import java.io.IOException;
import java.io.InputStream;
package com.dkarv.jdcallgraph.util.config;



public class ConfigUtils {

  public static void replace(boolean addDefaults, String... options) throws IOException {
    if (addDefaults) {
      new ConfigReader(
          ConfigUtils.class.getResourceAsStream("/com/dkarv/jdcallgraph/defaults.ini"),
          write(options)).read();
    } else {
      new ConfigReader(
          write(options)).read();
    }
  }

  public static InputStream write(String... options) throws IOException {
    StringBuilder str = new StringBuilder();
    for (String opt : options) {
      str.append(opt);
      str.append('\n');
    }
// Path: jdcallgraph/src/test/java/com/dkarv/jdcallgraph/helper/TestUtils.java
// public class TestUtils {
//   public static File writeFile(final TemporaryFolder tmp, String... content) throws IOException {
//     File configFile = tmp.newFile();
//     PrintWriter out = new PrintWriter(configFile, "UTF-8");
//     for (String line : content) {
//       out.println(line);
//     }
//     out.close();
//     return configFile;
//   }
// 
//   public static String readFile(final TemporaryFolder tmp, String fileName) throws IOException {
//     byte[] encoded = Files.readAllBytes(Paths.get(tmp.getRoot().getCanonicalPath(), fileName));
//     return new String(encoded, StandardCharsets.UTF_8);
//   }
// 
//   /**
//    * Clear/Empty a file.
//    */
//   public static void clear(TemporaryFolder tmp, String fileName) throws FileNotFoundException {
//     (new PrintWriter(new File(tmp.getRoot(), fileName))).close();
//   }
// 
//   public static InputStream writeInputStream(String content) throws UnsupportedEncodingException {
//     return new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8.name()));
//   }
// }


// Path: jdcallgraph/src/test/java/com/dkarv/jdcallgraph/util/config/ConfigUtils.java
import com.dkarv.jdcallgraph.helper.TestUtils;
import java.io.IOException;
import java.io.InputStream;

package com.dkarv.jdcallgraph.util.config;



public class ConfigUtils {

  public static void replace(boolean addDefaults, String... options) throws IOException {
    if (addDefaults) {
      new ConfigReader(
          ConfigUtils.class.getResourceAsStream("/com/dkarv/jdcallgraph/defaults.ini"),
          write(options)).read();
    } else {
      new ConfigReader(
          write(options)).read();
    }
  }

  public static InputStream write(String... options) throws IOException {
    StringBuilder str = new StringBuilder();
    for (String opt : options) {
      str.append(opt);
      str.append('\n');
    }
    return TestUtils.writeInputStream(str.toString());