I am altering a file by means of a FileStream (it is a very large file and I just need to alter the header without rewriting the whole thing.
The file can have either Unix or Windows line feeds, and it is important for me to know which so that I can write the correct line feed characters back into the file when I update it.
I could write a simple function to use a FileStream to read the file in blocks and check for the line feed characters.
But this problem must have been solved before, if not in C# then in the Win32 API?
What's the most efficient way to detect the line feed style of the file?