I don't understand what you are trying to do. But if you want to write out the byte array of the file then here is the code
DirectoryInfo da = new DirectoryInfo("C:\\\\Folder9");
FileInfo\[\] Arr = da.GetFiles();
FileInfo ap = Arr\[Arr.Length - 1\];
long Totbyte = ap.Length;//file length
string filePath = ap.FullName;//file name
byte\[\] data = File.ReadAllBytes(filePath);//reading entire file
for (int counter = 0; counter < Totbyte; counter++)
{
Console.Write(data\[counter\]);
}
Remember that is byte array, not bit array If you to write out bit array instead of byte array, replace
Console.Write(data[counter]);
Into
string yourByteString = Convert.ToString(data[counter], 2).PadLeft(8, '0');
Console.Write(yourByteString+" ");