Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如标题所述,我想打开几个 FileInputStream 对象来访问同一个文件以获取不同位置的数据。这样做安全吗,谢谢!
只要您所做的只是阅读,并且您的所有线程/流都没有对文件设置排他锁,那就很好了。
是的,从技术上讲,这只是从操作系统的角度并发读取文件,并且由于它没有在你的脚下修改,所以你很高兴。