X
xEM
I have ByteBuffer for example:
ByteBuffer bBuffer = ByteBuffer.allocate(1024);
How write data to and read data from SocketChannel that is big lenght
and put it into ByteBuffer that i will process later?
Normally when data fit in bBuffer i make this:
on server side:
---------------
bBuffer.put(data);
bBuffer.flip();
channel.write(bBuffer);
on client side:
---------------
channel.read(bBuffer);
bBuffer.flip();
But when i want to send more than 1024 bytes of data? How can i do?
that Any ideas ?
ByteBuffer bBuffer = ByteBuffer.allocate(1024);
How write data to and read data from SocketChannel that is big lenght
and put it into ByteBuffer that i will process later?
Normally when data fit in bBuffer i make this:
on server side:
---------------
bBuffer.put(data);
bBuffer.flip();
channel.write(bBuffer);
on client side:
---------------
channel.read(bBuffer);
bBuffer.flip();
But when i want to send more than 1024 bytes of data? How can i do?
that Any ideas ?