C# BinaryReader.BaseStream Caution Remark

On the BinaryReader.BaseStream C# API Page, the following Caution Statement is made in the Remarks Section:

Using the underlying stream while reading or while using the BinaryReader can cause data loss and corruption. For example, the same bytes might be read more than once, bytes might be skipped, or character reading might become unpredictable.

Can anyone elaborate on this statement?

Here are some questions for starters:

  1. Why would the same byte be read more than once?
  2. Why would a byte be skipped?
  3. Why would character reading become unpredictable?
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.