O
Olav Tollefsen
I have a class defines like this:
public enum MessageType : int
{
AddSubscription = 0,
RemoveSubscription = 1,
DistributeMessage = 2
}
public class Message
{
public MessageType messageType;
public string messageName;
public byte[] body;
public Message()
{
}
}
Given that I have an instance of this class, how can I convert it to byte[]
and vice versa?
I need to pass it to Socket.Send and Socket.Receive.
public enum MessageType : int
{
AddSubscription = 0,
RemoveSubscription = 1,
DistributeMessage = 2
}
public class Message
{
public MessageType messageType;
public string messageName;
public byte[] body;
public Message()
{
}
}
Given that I have an instance of this class, how can I convert it to byte[]
and vice versa?
I need to pass it to Socket.Send and Socket.Receive.