how to decide ByteBuffer size created for SocketChannel.read(ByteBuffer)
Hi,
Is there any way by which we can know the size of data ready to be read at the SocketChannel?
When the "SelectionKey" is discovered to be "isReadable()" I would like to create the ByteBuffer of the required size and use it for the SocketChannel.read(ByteBuffer) method.
Right now I have to statically fix the ByteBuffer size to some safe maximum limit for this "read" method, which somehow is not looking efficient technique to me.
Thanks in advance
Amit

