users@glassfish.java.net

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

From: <glassfish_at_javadesktop.org>
Date: Wed, 25 Mar 2009 03:22:05 PDT

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)]

http://forums.java.net/jive/thread.jspa?messageID=338907