reading buffered binary file (with seek)

后端 未结 2 1135
抹茶落季
抹茶落季 2021-01-03 16:22

Say I need to read huge binary file of integers, a handy way is:

FileInputStream fi = new FileInputStream(file);
BufferedInputStream bi = new BufferedInput         


        
2条回答
  •  隐瞒了意图╮
    2021-01-03 16:48

    Just start with fi.skip(position) before wrapping it with bi and di. The underlying stream actually makes a call to seek when position is sufficiently large.

提交回复
热议问题