c# - Using a custom Stream in Windows Store app -


i have .net code dealing custom stream need port winrt. motivation is, app reads file encrypted (the custom stream). in full .net use

 var readfilestream = file.openread(bookpath);  var readdecryptedstream = new mystream(password, readfilestream);  //it zip file  var readzipfile = new zipfile(readdecryptedstream);  //extract files zip file 

mystream inherits stream , encoding , decoding in read / write methods, full code here http://dl.dropbox.com/u/73642/mystream.cs. code works fine in .net.

my winrt implementation is

var file =await applicationdata.current.localfolder.getfileasync(bookpath); //i copied same file local folder var filestream = await file.openstreamforreadasync(); var readdecryptedstream = new mystream(password, readfilestream); ziparchive z = new ziparchive(readdecryptedstream , ziparchivemode.read); 

the problem code new ziparchive(readdecryptedstream , ziparchivemode.read); never finishes reading stream. when set breakpoint in mystream read method, gets called offset=0 time (therefore never finishes).

when use unencrypted file new ziparchive(filestream , ziparchivemode.read); works problem must mystream implementation.

any idea problem? custom stream need different implementation on winrt in full .net?

i solved restarting computer. strange streams, including reading files applicatondata stop working , have restart computer. real pain.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -