I want to open multiple binary files in Java at once, but I do not want to instantiate all of them manually in this way as follows. Is there an automatic way, or a method for me to streamline it?
Example:
File arquivo = new File("temp0.bin");
FileInputStream fis0 = new FileInputStream(arquivo);
DataInputStream dis0 = new DataInputStream(fis0);
arquivo = new File("temp1.bin");
FileInputStream fis1 = new FileInputStream(arquivo);
DataInputStream dis1 = new DataInputStream(fis1);
arquivo = new File("temp2.bin");
FileInputStream fis2 = new FileInputStream(arquivo);
DataInputStream dis2 = new DataInputStream(fis2);
arquivo = new File("temp3.bin");
FileInputStream fis3 = new FileInputStream(arquivo);
DataInputStream dis3 = new DataInputStream(fis3);