反序列化从套接字获取的流 [英] Deserialize an stream recived from a socket

查看:68
本文介绍了反序列化从套接字获取的流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我的问题是我有客户端-服务器"程序,而我遇到的一个问题是从服务器向客户端接收对象.在服务器中,我已经序列化了该对象并发送了该对象,但是在客户端中,我以字节数组的格式接收了该对象,但是无法将其转换为对象.有人可以帮我吗?

Hello there. My question is that I have Client-Server program, and I''m having a problem form recive a object form the server to the client. In the server I have serialized the object and sent it, but in the client I recive the object in the format of an byte array but I cannot convert it into a object. Can anyone help me?

推荐答案

好了,我已经解释了怎么做 ^ ];这只是序列化过程的逆过程.因为这是您的对象,所以您是唯一知道重新创建它需要哪些步骤的人.
Well I already explained what to do here[^]; it''s just the reverse of the serialisation process. Since this is your object you are the only person who knows what steps are required to recreate it.


不,因为唯一的答案可能是使用序列化",但是您正在尝试表示您已经使用它.而且您没有试图解释什么是您的真正问题.您不认为在这种情况下提供更多帮助非常困难吗?

—SA
No, because the only answer could be "use serialization", but you''re trying to say you already use it. And you are not trying to explain what''s your real problem. Don''t you think it''s pretty difficult to provide more help in this situation?

—SA


这篇关于反序列化从套接字获取的流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆