I try to count data with FileStream . It seems like everything looks fine, but as a result I get 5 records of the same array ( byte[] ) in tmp .
Apparently, I misunderstand the logic of reading from this stream. Tell me, what's the problem?
using (FileStream fs = File.OpenRead(filePath)) { List<byte[]> tmp = new List<byte[]>(); while ((read = fs.Read(buffer, 0, buffer.Length)) > 0) { tmp.Add(buffer); } }