I am working on calling a main(String[] args) method on quite large datasets and files. The method uses a number parameter files, which it calls using their filenames. However, because of the file size, it takes too long and is not really realistic. Therefore, I have decided to break down the files into small chunks. The simplest idea was to read the main file and write each chunk to a smaller file and call the method a certain number of times. This takes still some time and is not optimal. Therefore, I am curious whether I can simply create an in memory file and call it as a parameter of my method. Is this possible?
Below is a copy of my code. I can create the reference files in preprocessing, but I would specifically like to generate the target file in memory and call it in.
Thanks!
String target = "targetFile.txt";
String ref = "referenceFile.txt";
String output = "outputFile.txt";
String[] imputationArgs = new String[]{ref, target, output};
Main.main(imputationArgs);