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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e97740-165a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e97740-165a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?