guttikonda wrote:
Thanks for all the suggestions.I tried using ByteArrayInputStream and it
worked.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream writer = new DataOutputStream(baos);
writer.writeUTF(msg);
session.write(ByteBuffer.wrap(baos.toByteArray());
AND, about the quote saying that "the network layer may decide to deliver
your message in several packets. The result is that you cannot assume
that a ByteBuffer passed in to your IoHandler.messageReceived() method
contains a complete message".Is it always or when using
ByteBuffer.getPrefixedString(...) method only? Please help.
This is always the case. Please have a look at the Protocol Codec tutorial:
http://mina.apache.org/tutorial-on-protocolcodecfilter.html
and the Reverser and SumUp examples:
http://mina.apache.org/documentation.html#Documentation-Examples
/Niklas