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!
-
Stu Thompson wrote this answer 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– Der_Reparator2021-11-23 12:33:38 +00:00Commented Nov 23, 2021 at 12:33
Add a comment
|
1 Answer
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.
1 Comment
leonbear
Thanks for your answer ! For more detail, if I use a fixed length buffer rather than a random length buffer, will it be more performant ?