Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all articles
Browse latest Browse all 239

New Post: NotImplementedException throwed when read a stream

$
0
0
Hi,

I want to read a compressed stream using SharpCompress to decompress the stream but a NotImplementedException is throwed when I tried to do it. Here is the code:
Stream stream = await GetStreamAsync(uri);

                if (stream == null)
                {
                    return null;
                }

                stream = new GZipStream(stream, CompressionMode.Decompress);
String textResult;
                using (var streamReader = new StreamReader(stream))
                {
                    textResult = await streamReader.ReadToEndAsync(); // Throws the exception
                }
Here is the stacktrace:
   at SharpCompress.Compressor.Deflate.GZipStream.get_Length()
   at System.IO.StreamReader.ReadToEnd()
   at AsyncExtensions.<>c__DisplayClass12.<ReadToEndAsync>b__11()
   at System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj)
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal()
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.Tasks.TaskScheduler.TryExecuteTask(Task task)
   at System.Threading.Tasks.ThreadPoolTaskScheduler.<.ctor>b__0(Object state)
   at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadPool.WorkItem.doWork(Object o)
   at System.Threading.Timer.ring()
Best

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>