private static void copyFile(File src,File dst,Integer port,boolean internalCompression) throws IOException {
  BufferedReader in=new BufferedReader(new InputStreamReader(new FileInputStream(src),StandardCharsets.UTF_8));
  Writer out=new OutputStreamWriter(new FileOutputStream(dst),StandardCharsets.UTF_8);
  for (String line=in.readLine(); null != line; line=in.readLine()) {
    if (null != port)     line=line.replace("TEST_PORT",port.toString());
    line=line.replace("COMPRESSION",internalCompression ? "internal" : "false");
    out.write(line);
  }
  in.close();
  out.close();
}

private static void copyFile ( File src , File dst , Integer port , boolean internalCompression ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( new FileInputStream ( src ) , StandardCharsets . UTF_8 ) ) ; Writer out = new OutputStreamWriter ( new FileOutputStream ( dst ) , StandardCharsets . UTF_8 ) ; for ( String line = in . readLine ( ) ; null != line ; line = in . readLine ( ) ) { if ( null != port ) line = line . replace ( "TEST_PORT" , port . toString ( ) ) ; line = line . replace ( "COMPRESSION" , internalCompression ? "internal" : "false" ) ; out . write ( line ) ; } in . close ( ) ; out . close ( ) ; }
character copy of file using utf - 8 . if port is non - null , will be substituted any time " test_port " is found .
