[API Proposal]: BinaryReader.ReadExactly #101614
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.IO
untriaged
New issue has not been triaged by the area owner
Background and motivation
When reading custom binary formats one very often needs a specific number of bytes. The existing
Read()
method doesn't read a specific number of bytes, it reads as many bytes are currently available. Calling code has to handle this.We had the same issue on
Stream
and solved this by exposingStream.ReadExactly
andStream.ReadAtLeast
.API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: