CSharp examples for System:Byte Array
Receives a byte array and returns it transformed in an sbyte array
using System;//w w w.j a v a 2 s. c o m public class Main{ /*******************************/ /// <summary> /// Receives a byte array and returns it transformed in an sbyte array /// </summary> /// <param name="byteArray">Byte array to process</param> /// <returns>The transformed array</returns> public static sbyte[] ToSByteArray(byte[] byteArray) { sbyte[] sbyteArray = null; if (byteArray != null) { sbyteArray = new sbyte[byteArray.Length]; for(int index=0; index < byteArray.Length; index++) sbyteArray[index] = (sbyte) byteArray[index]; } return sbyteArray; } }