Top "Streamwriter" questions

StreamWriter is designed for character output in a particular encoding, whereas classes derived from Stream are designed for byte input and output.

What is the purpose of StreamReader when Stream.Read() exists?

This has been bugging me. I know Stream is an abstract class and therefore can't be instantiated but it has …

c# io stream streamreader streamwriter
FileStream and StreamWriter - How to truncate the remainder of the file after writing?

var fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite); using(var writer = new StreamWriter(fs)) writer.Write(....); If the file …

.net io filestream streamwriter
StreamWriter end line with Lf rather than CrLf

I'm using StreamWriter to output a text file, but I would like to end my WriteLine with Lf rather than …

.net text streamwriter
StreamWriter limit in C# in text file

I have an array list which contains 100 lines. When i try to export it into a text file (txt), the …

c# text-files limit streamwriter
Apache POI: SXSSFWorkbook.dispose() does not exist

I'm using apache's POI API to write XLSX files. Since I need to write big files, I'm using the Streaming …

excel streaming apache-poi streamwriter
Alternative/faster method to slow StreamWriter to print strings to a file in C#

Some help from experts. I'm trying to use the function below to print strings to a file. When I use …

c# streamwriter writetofile
Does a Stream get Disposed when returning a File from an Action?

I'm writing a string to a MemoryStream I need to return the stream to the Controller Action so I can …

c# asp.net-core asp.net-core-mvc streamwriter memorystream
How I get the best performance out of .NET's StreamWriter in C#?

What is the recommended approach to get the best performance when we need to create text files bigger than 10 MB? …

.net performance file-io streamwriter
Why is my text file incomplete after using StreamWriter object?

I wrote a small program which generates big text files. I found using a StreamWriter is much, much faster than …

powershell streamwriter
How to write Arabic, Hebrew Into CSV file?

I can't write to Results.csv any of the languages Arabic or Hebrew, except English. Each time I'm trying to …

c# csv encoding streamwriter