users@glassfish.java.net

Re: in grizzly samples: How to replace the ObjectInputStream with bytes?

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 30 Mar 2009 09:28:13 -0400

Salut,

glassfish_at_javadesktop.org wrote:
> grizzly samples: How to replace the ObjectInputStream with bytes?
> it doesn't work.
> anyone can help me ?
> ///////////////////////////////to be replaced//////////////////////////////////////////
> //ObjectInputStream ois = new ObjectInputStream(stream);
> //Object[] result = (Object[]) ois.readObject();
> //ois.close();
> //return result;
> ////////////////////////////replace with/////////////////////////////////////////////////
> BufferedInputStream bis = new BufferedInputStream(stream);
> byte[] buf = new byte[bis.available()];
> int read = bis.read(buf);
> String s = new String(buf,"gbk");
> System.out.println("rcv["+s+"]");
> /////////////////////////////////////////////////////////////////////////////////////////////
> [Message sent by forum member 'jdpeng' (jdpeng)]

Can you point me to the sample you are using?

Thanks,

-- Jeanfrancois




>
> http://forums.java.net/jive/thread.jspa?messageID=338907
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>