I am a newb in Java programing, and confused about IO API. For System API, read/write a entire block works faster than a random bytes. Can Java implements this feature? Or how to optimize performance during Java IO? I am pretty appreciated for anything you comment, thank you very much!
Asked
Active
Viewed 44 times
0
-
Stu Thompson wrote [this answer](https://stackoverflow.com/a/1690724/8383428) about a similar problem. He argues that the size of the pre-allocated buffer matters. So I would conclude that yes, a properly sized buffer is contributing to IO performance. – Der_Reparator Nov 23 '21 at 12:33
1 Answers
-1
I'm a newb too but you may be able to use arrays and buffers with io. Or use NIO which is based off buffers and is non-blocking, so I believe is faster, but I'm not sure.

maxkcy
- 1
- 2
-
1Thanks for your answer ! For more detail, if I use a fixed length buffer rather than a random length buffer, will it be more performant ? – leonbear Nov 23 '21 at 09:22