Hello everyone!

I'm making a NIO TCP/IP server for my game and i'd love to know how to read a specified amount of data from the stream without removing the rest(Like typical IO, eg. s.getInputStream.read(buffer, offset, len)).

For my client it works fine since im using a blocking socket in a seperate thread but as for my server i am at loss.

Any answers are appreciated! Thanks in advance and let me know if there is anything else you'd like to know!

Kind regards,