Search code examples
c#bufferbinaryreader

What does the FillBuffer method of BinaryReader do?


According to the documentation:

Fills the internal buffer with the specified number of bytes read from the stream.

What does this mean (what's the internal buffer?)?


Solution

  • The BinaryReader has an internal buffer so that it doesn't need to perform as many small reads on the underlying stream, especially also when reading character data which may need some lookahead. You shouldn't need to call this manually.