how to convert an sByte array to byte array

  • Thread starter Thread starter reju
  • Start date Start date
R

reju

I have to convert an sByte array to byte array.
This sbyte array contains some signed values due to this .net
converting functions will throw an exception.any work around for this?

is there any way to pass sbyte array to stream classes eg: memory
stream?
 
Howdy,

sbyte[] src = new sbyte[] { -1, 1, -2, 2 };
byte[] dest = new byte[src.Length];
System.Buffer.BlockCopy(src, 0, dest, 0, src.Length);
 
Howdy,

sbyte[] src = new sbyte[] { -1, 1, -2, 2 };
byte[] dest = new byte[src.Length];
System.Buffer.BlockCopy(src, 0, dest, 0, src.Length);
--
Milosz

reju said:
I have to convert an sByte array to byte array.
This sbyte array contains some signed values due to this .net
converting functions will throw an exception.any work around for this?
is there any way to pass sbyte array to stream classes eg: memory
stream?


Great Milosz

it works
Thanks
 
Back
Top