mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon V." <sybersn...@gmail.com>
Subject Re: How to write byte[] to an IoSession
Date Wed, 12 Mar 2014 15:45:31 GMT
You are converting an incoming iobuffer to byte[] you need to write an
iobuffer.
On Mar 12, 2014 11:34 AM, "dinesh707" <dinesh707@gmail.com> wrote:

> As shown below I can read the byte[] sent from an IoSession without having
> a
> protocol decoder.
>
> IoBuffer in = (IoBuffer) message;
> byte[] inBytes = in.array();
> int length = inBytes[0];
> inBytes = Arrays.copyOfRange(inBytes, 1, length + 1);
> ByteString incomingMessage = ByteString.copyFrom(inBytes);
>
> But when I try to do
>
> someIoSession.write(incomingMessage.toByteArray());
>
> I get the following error.
>
> Don't know how to handle message of type XXXX.  Are you missing a protocol
> encoder?
>
> How can i just write the bytes into an IoSession ??
>
>
>
>
> --
> View this message in context:
> http://apache-mina.10907.n7.nabble.com/How-to-write-byte-to-an-IoSession-tp41542.html
> Sent from the Apache MINA User Forum mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message