0
I want to open several binary Java files at once, but I don’t want to instantiate them all manually this way as follows in example. Is there an automatic way, or a method so I can speed this up?
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);
Wesley, no need to quote the language in the title, since the question already has the tag, it is redundant.
– user28595
First time here, I’ll get the hang of it yet.
– Weslley Campos
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site (when you have enough score).
– Maniero