Might a Stream write less than the buffer size?

The intellisenses for Stream.Read and Stream.Write are very similar. Which leads me to the question of whether Write has the same gotcha as Read - It reads at most as many bytes as in the buffer. Not necessarily filling the buffer even when there are more to be read.

MSDN doesn't seem to say that there is. But I'm still asking because this is a tricky "feature" - since it usually works fine - one might not encounter it while testing.

Jon Skeet
people
quotationmark

No, Write will always write everything you ask it to. It may be buffered along the way, but you don't need to worry about "rewriting" in the same way as you repeatedly read data.

people

See more on this question at Stackoverflow