Fastest way to write an array of integers to a file in Java?

前端 未结 6 485
小鲜肉
小鲜肉 2020-12-05 08:33

As the title says, I\'m looking for the fastest possible way to write integer arrays to files. The arrays will vary in size, and will realistically contain anywhere between

6条回答
  •  攒了一身酷
    2020-12-05 08:54

    I think you should consider using file channels (the java.nio library) instead of plain streams (java.io). A good starting point is this interesting discussion: Java NIO FileChannel versus FileOutputstream performance / usefulness

    and the relevant comments below.

    Cheers!

提交回复
热议问题