C
C#10mo ago
Sander

reccomendations for learning how to work with streams.

Im trying to dive deeper into how streams work in C# but i find it hard to jugde what source is a good source to learn from. does anyone have good reccomendations?
8 Replies
Jimmacle
Jimmacle10mo ago
the official documentation is a good place to start https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-8.0
Stream Class (System.IO)
Provides a generic view of a sequence of bytes. This is an abstract class.
Sander
SanderOP10mo ago
thanks 👍
Mayor McCheese
Mayor McCheese10mo ago
You can start with MemoryStreams and use a predictable set of data and see how it's read and how streaming api's typically work.
Mayor McCheese
Mayor McCheese10mo ago
There's a note about IDisposable in the middle of that page btw, you should totally ignore it.
Sander
SanderOP10mo ago
so i should dispose of memory streams?
Jimmacle
Jimmacle10mo ago
for memory streams there's nothing to dispose, the backing store is just an array other kinds of streams like network streams may be holding onto other resources like a socket that need to be disposed
Mayor McCheese
Mayor McCheese10mo ago
There's no consequence to not disposing of memory streams, but it's a bad practice to not dispose streams; there's also no reason not to.
Want results from more Discord servers?
Add your server