Can BufferedInputStream continue to read the next file stream without closing it?

continuous reading of small files, BufferedInputStream seems to create a new one for each file, can you create it only once, and then read the next file after reading this file? is there any way to do this?

Apr.25,2022

you need to make it clear that what's wrong with creating each file once? What problem are you trying to solve?


Of course, you can't just create it once, and there's no way you want it. No matter how small the file is, you can't skip the open process. You only give a file path , the operating system can't know where the file you want is located on the hard disk. The process of open is the process that the operating system converts file path to the hard disk location. The creation of InputStream includes the process of open , so each file must create a InputStream .

and your idea is so strange.

Menu