0

Is there an equivalent of the System.IO.BufferedStream class for WinRT? The class itself isn't available, but is there a way to achieve the same behavior?

Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758

1 Answers1

1

No, but you can use any of Windows Runtime streams with AsStream... extension methods. They create a "wrapper" streams that contain an internal buffer, and you can set its size. Refer to Stream performance in C# and Visual Basic section of Access the file system efficiently MSDN document.

Alovchin
  • 663
  • 3
  • 9
  • 1
    Actually, I'm doing the opposite (I need a `System.IO.Stream` around a WinRT stream); I had not realized that `AsStreamForRead` created a buffered stream, but the article you linked to makes it clear. Thanks! – Thomas Levesque Oct 08 '14 at 08:19
  • Ah, I'm sorry I misspelled those methods :) I meant `AsStream...` methods to wrap WinRT streams, of course :) – Alovchin Oct 08 '14 at 09:29