0

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!

1
  • 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. Commented Nov 23, 2021 at 12:33

1 Answer 1

-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.

Sign up to request clarification or add additional context in comments.

1 Comment

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 ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.