c# - What's the socially acceptable way to leave a Stream after using it? -


if designing api, or within own code, , method accepts stream, method's duty check position , reset beginning provided canseek true before using it?

if so, why isn't there method on stream class itself?

over years i've been caught out few times assuming stream comes method in position 0.

and right reset stream possible after using it?

alternatively, should streams copied around instead of passed around directly? seems bit excessive me.

is method's duty check position , reset beginning provided canseek true before using it?

no, in case expect calling code prepare stream correctly.

the common patterns share stream on methods require pointer left after last read/write, never comes much.

but best thing after using it: nothing.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -