CSharp examples for System:Byte Array
Get Bytes from short type array
using System;// www. j av a 2s .c o m public class Main{ public static void GetBytes(short[] input,int count,byte[] output) { for (var i = 0; i < count; ++i ) { var bytes = BitConverter.GetBytes(input[i]); output[i * 2] = bytes[0]; output[i * 2 +1] = bytes[1]; } } }