Reading data from a File while it is being written to

后端 未结 2 1100
时光说笑
时光说笑 2021-02-06 13:37

I\'m using a propriatery Java library that saves its data directly into a java.io.File, but I need be able to read the data so it\'s directly streamed. Data is bina

2条回答
  •  一向
    一向 (楼主)
    2021-02-06 14:05

    assuming file writing behaviour is intrinsic to the library, you should check its documentation to see if you can avoid writing to the file system. Generally speaking, if you want to read a file that is being written to (i.e. *nix tail-like behaviour), you can use java.io.RandomAccessFile

提交回复
热议问题