public static List <SudokuPuzzle> ReadFile(String filename) { List <SudokuPuzzle> puzzles = new List <SudokuPuzzle>(); using (StreamReader stream = new StreamReader(new BufferedStream(File.OpenRead(filename)))) { if (stream.EndOfStream) { throw new ArgumentException(BAD_FILE_ERRMSG); } while (!stream.EndOfStream) { puzzles.Add(SudokuPuzzle.CreateFromStream(stream)); } } return(puzzles); }