what is the difference between windows.storage.streams and system.io.stream?

Viewed 50

what is the difference between windows.storage.streams and system.io.stream? When should we use windows.storage.streams over system.io.stream in UWP?

1 Answers

First of all, windows.storage.streams is a namespace and system.io.stream is a class.

The system.io.stream belongs to .Net and you could use it anywhere that uses .Net. You could use it in UWP apps as well but most of the UWP APIs require a special steam class as the parameter like FileInputStream. So you have to convert the system.io.stream object to IRandomAccessStream.

The windows.storage.streams namespace contains many steam classes that work for different scenarios like FileInputStream. These streams are designed for Windows Runtime. So when you are developing a UWP app, you should use the steams from the windows.storage.streams namespace.

Related