Modified WriteToCSV method for connectionStream data
New method to write Stream in WriteToCsv