users@glassfish.java.net

Re: Re: in grizzly samples: How to replace the ObjectInputStream withbytes?

From: Jdpeng <ca520_at_21cn.com>
Date: Thu, 2 Apr 2009 09:02:19 +0800

Jeanfrancois Arcand,您好!

        I have solved this problem.My metod is wrong,I find the better way to write to ByteBuffer.
thanks however.

======= 2009-03-30 21:28:25 您在来信中写道:=======

>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
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

= = = = = = = = = = = = = = = = = = = =
                        

        致
礼!
 
                                 
        Jdpeng
        ca520_at_21cn.com
          2009-04-02