title: BinaryReader and Stream performance on WP7
body: <p>The question...</p>
  
  <p>If you must have a BinaryReader opend to a file, is there a more performant way to do it than opening a Stream to a Resource?</p>
  
  <pre><code> System.IO.Stream myFileStream = Application.GetResourceStream(new Uri @"/MyApp;component/sdb.data", UriKind.Relative)).Stream;
   BinaryReader binaryReader = new BinaryReader(myFileStream);
  </code></pre>
  
  <p>All the rest...</p>
  
  <p>I am using the <a href="http://sterling.codeplex.com/" rel="nofollow">Sterling</a> Database (codeplex) for a WP7 app. The app is required to ship with a large db already inside the assembly. Currently, I am attempting a Restore() with Sterling to create a database from a file that holds a previously saved ( Backup() ). Currently, I am taking the backup file and setting it as a 'Resource' in the app, as shown above. The Sterling dtabase engine requires a BinaryReader to load the data via a Restore(). Currently, the restore just takes too long. I have a discussion started in the <a href="http://sterling.codeplex.com/discussions/257288" rel="nofollow">Sterling Discussions</a>, but posted here on Stack just to see if I could do better than a stream to a resource.</p>