The C# version only makes a syscall if the buffer is empty: https://github.com/dotnet/runtime/blob/1ba0394d71a4ea6bee7f6...
To read in binary, you open with 'rb' and not just 'r'
To read in binary, you open with 'rb' and not just 'r'
> To read in binary, you open with 'rb' and not just 'r'.
No. "The default translation mode is 'b'." [1] And even in 't' mode, it's still reading bytes in PHP vs UCS-2 characters in C#.
int StreamReader.Read()
int StreamReader.Read(char[] buffer, int index, int count)
https://github.com/dotnet/runtime/blob/1ba0394d71a4ea6bee7f6...