我在从客户端接收用 Java 编写的对象时遇到问题。我 100% 确定我的客户端代码,这很好。但是当我尝试从我的 C# 异步服务器接收几个错误时,我认为这是因为我真的不知道如何获取它的流
int iRx = socketData.m_currentSocket.EndReceive(asyn);
byte[] receivedData = socketData.dataBuffer;
MemoryStream memStream = new MemoryStream();
BinaryFormatter binForm = new BinaryFormatter();
memStream.Write(receivedData, 0, receivedData.Length);
memStream.Seek(0, SeekOrigin.Begin);
UserData usdata = (UserData)binForm.Deserialize(memStream);