I'm currently working in a java to c# conversion project. In one part I got this Java code snippet.
public CustomType someMethod(Message msg) throws IOException
{
byte[] data = msg.toString().getBytes();
}
to my understanding, data contains the byte representation of the string msg.toString()
But when I try to write it in C# like following format, i get errors.
public CustomType someMethod(Message msg)
{
try
{
byte[] data= byte.Parse(msg.ToString());
}
catch(IOException e)
{
throw e;
}
}
how can I solve this problem?