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?)?
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?)?
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.
Notice that the method is declared as protected.
As such, it is only of interest if you want to create a class that inherits from BinaryReader, which you seldom need to do.
It looks like the main aim here is to allow you to have a convenient method to ensure that you have a block of data locally; for example, when reading a "double" you would (typically) want 8 bytes. This method wraps up:
However, it seems unlikely you would need to call it externally, unless you were reading a small 'byte[]'
As for the internal buffer; simply, when deserializing you:
So just work