Solution is simple, just two instructions (which are marked in following code), simply convert byte to binary using Convert.ToString(btindx,2)
, zero pad the resultant string to 8 bits (or lengths 8),strBin.PadLeft(8,'0');
and concatenate all binary strings to form a bit stream of your byte array, If you like, you can also form an array of strings to separate each byte's binary representation.
byte[] bt = new byte[2] {1,2};
string strBin =string.Empty;
byte btindx = 0;
string strAllbin = string.Empty;
for (int i = 0; i < bt.Length; i++)
{
btindx = bt[i];
strBin = Convert.ToString(btindx,2); // Convert from Byte to Bin
strBin = strBin.PadLeft(8,'0'); // Zero Pad
strAllbin += strBin;
}