- C# code
public uint MessageLength { get { return (uint)IPAddress.NetworkToHostOrder((int)_messageLength); } set { _messageLength = (uint)IPAddress.HostToNetworkOrder((int)value); } }
- C# code
public byte[] GetBytes() { byte[] result = new byte[this.GetLength()]; Buffer.BlockCopy(_head.GetBytes(), 0, result, 0, _head.GetLength()); Buffer.BlockCopy(_body.GetBytes(), 0, result, _head.GetLength(), _body.GetLength()); return result; }
------解决方案--------------------------------------------------------
111