AnantLabs / tar-cs

Automatically exported from code.google.com/p/tar-cs
Other
1 stars 1 forks source link

inStream.Position throws NotSupportedException #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Reading GZipStream as input stream
2. Running in debug mode
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
0.92

Please provide any additional information below.

add line "if (inStream.CanSeek)" before every "Debug.WriteLine("tar stream
position MoveNext in: " + inStream.Position);"

Original issue reported on code.google.com by jure.mi...@gmail.com on 28 Oct 2009 at 11:21

GoogleCodeExporter commented 9 years ago
Could you please provide a code example?

Original comment by vasilt...@gmail.com on 17 Jun 2011 at 8:25

GoogleCodeExporter commented 9 years ago
I ran across this issue as well.  GZipStream throws an exception when you 
access inStream.Position.

Example:

            using (System.IO.FileStream fs = System.IO.File.Create(fileName))
            {
                using (var outStream = new GZipStream(fs, CompressionMode.Compress))
                {
                    using (var writer = new TarWriter(outStream))
                    {
                        foreach (var entry in fileMap)
                        {
                            using (MemoryStream fileStream = new MemoryStream(entry.Value)) {
                                writer.Write(fileStream, fileStream.Length, entry.Key);
                            }
                        }
                    }
                }
            }

Original comment by tool...@gmail.com on 20 Feb 2013 at 9:49

GoogleCodeExporter commented 9 years ago
I tried it on this code. Did not get how to reproduce it. Will do a separate 
branch for testing on it.

Original comment by vasilt...@gmail.com on 18 Jan 2014 at 11:58

GoogleCodeExporter commented 9 years ago
Ok, I found when it happens. It's fixed.

Original comment by vasilt...@gmail.com on 19 Jan 2014 at 12:44