G
Guest
I have a byte array (myArray) filled by reading bytes from the Com port. And
I need to check for a termination byte (0x00 or "\0") as well as for a
combination of bytes/ASCII characters (myString).
I have to provide best possible performance.
I'm wunderring if there is any internal boxing involved in the statements
like the following:
byte myByte = 0x00;
if (Array.LastIndexOf(myArray, myByte) >= 0)
...
String sbuffer = Encoding.ASCII.GetString(myArray, 0, cnt);
if (sbuffer.LastIndexOf(myString) >= 0)
...
Thanks,
Valentina
I need to check for a termination byte (0x00 or "\0") as well as for a
combination of bytes/ASCII characters (myString).
I have to provide best possible performance.
I'm wunderring if there is any internal boxing involved in the statements
like the following:
byte myByte = 0x00;
if (Array.LastIndexOf(myArray, myByte) >= 0)
...
String sbuffer = Encoding.ASCII.GetString(myArray, 0, cnt);
if (sbuffer.LastIndexOf(myString) >= 0)
...
Thanks,
Valentina