CSharp examples for System:Byte Array
Convert byte array To Int64
using System.Text; using System;//from w w w. j a v a 2 s.co m public class Main{ public static Int64[] ToInt64(byte[] source, int sourceOffset, int size) { var arr = new Int64[size]; for (int i = 0; i < size; i++) arr[i] = bitConverter.ToInt16(source, sourceOffset + (i * sizeof(Int64))); return arr; } public static Int16[] ToInt16(byte[] source, int sourceOffset, int size) { var arr = new Int16[size]; for (int i = 0; i < size; i++) arr[i] = bitConverter.ToInt16(source, sourceOffset + (i * sizeof(Int16))); return arr; } }