Reputation: 127
Hello I'm currently trying to learn the NIO paradigm and have some question in order to understand better this way of coding. In non-blocking mode :
Why should I use a selector for the writing process ? why not directly use the write method if i have a hmi.
how could I read a single line from a byteBuffer ?
Thanks for your help
Upvotes: 0
Views: 70
Reputation: 310884
Why should I use a selector for the writing process?
You shouldn't, unless you have had a zero-length write.
why not directly use the write method if i have a hmi.
Exactly, that's what you should normally do.
how could I read a single line from a byteBuffer?
A byte at a time. It doesn't have a notion of lines.
Upvotes: 2