you should store the amount of items in that file as the first item. so before you for your for loop to write, you do bw.Write(wiki.Count)bw.Write(wiki.Count) then instead of doing the length of the stream (which is the size in bytes) you do br.ReadInt32()br.ReadInt32() for the amount to iterate