Maybe this example is working (I'm using MINA 2.0.0-M1):

        byte[] bytes = new byte[100];
>         Arrays.fill(bytes, (byte)65);


>
        IoBuffer buf = IoBuffer.allocate(64);
>         buf.setAutoExpand(true);
>
>         buf.put(bytes);
>
>         buf.flip();
>         session.write(buf);



2008/7/2 playboyleekelin <[EMAIL PROTECTED]>:

>
>
> hi,
>
>     i need send byte[] with mina.
>
> please give me demo?
>
>
>
>                int blen = gkbPkg.createLoginRespPackage(1).length;
>                System.out.println("------------------------> len:" + blen
> );
>                ByteBuffer buf = ByteBuffer.allocate( blen ) ;
>                if(buf!=null){
>                    System.out.println("send...");
>                    //buf.clear();
>                    //bb.get(gkbPkg.createLoginRespPackage(1));
>                    buf.put( gkbPkg.createLoginRespPackage(1) );
>                    //buf.put((byte) '.');
>                    //buf.flip();
>                    //session.write(bb.duplicate());
>                    session.write(buf);
>                    //buf.clear();
>                }
>
> Exception




-- 
Balázs Viktor
Amkai Kft. (1188 Budapest, Szövet u. 9.)

Email: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]
Telefon: +36-30/6755532

Reply via email to