I've a byte array
byte[] arrOutput = { 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0x04, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00, 0x09, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Note the 0xff.
With BlockCopy
I made a replacement in byte array. Then I'm faced with the problem, to convert array to a binary string.
I tried (with a couple of encodings)
Encoding altEnc = Encoding.GetEncoding("????");
body = altEnc.GetString(data);
This does not work. When I use e.g. ASCII it cannot work because of the limitation to the max. support of 0x7f. Uf I use UTF-8 I get multiple bytes and never a 0xff.
I could not find any solution which convert bytes back to string... Any help appreciated.