.NET streams, passing streams between objects, best practices (C#)

后端 未结 4 2130
温柔的废话
温柔的废话 2020-12-31 12:31

I\'m currently writing a little toy assembler in c# (going through the elements of computing systems book. Really good book by the way.)

The assembler takes an input

4条回答
  •  情歌与酒
    2020-12-31 12:54

    Overall, I agree with the previous comments. However if your model doesn't fit that, you could do what Microsoft did with the XML Writer: It accepts an XMLWriterSettings parameter when you instance it, and one of the properties of the settings object describes whether the writer should close the underlying stream when the writer is disposed.

提交回复
热议问题