Re: Problem with ICSharpCode.SharpZipLib.Zip

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Maxim Kazitov (mvkazit_at_tut.by)
Date: 10/08/04


Date: Thu, 07 Oct 2004 19:01:58 -0700


ZipFile.GetInputStream return InflaterInputStream.

InflaterInputStream.Close() - close baseStream in ZipFile.

Some .Net Objects, for Example XPathDocument close stream after reading.
 
So,
 
if you comment stream closing in (InflaterInputStream.cs) problem go on
:

-------------------------------
public override void Close()
{
    //baseInputStream.Close();
}
--------------------------------

I resolve this problem using temporary stream :
 
Stream oStream = oZipFile.GetInputStream(oEntry);
String sXml = new StreamReader(oStream).ReadToEnd();
MemoryStream oSMem = new MemoryStream(sXml.Length);
StreamWriter oSWriter = new StreamWriter(oSMem);
oSWriter.Write(sXml);
oSWriter.Flush();
oSMem.Seek(0, SeekOrigin.Begin);
 
XPathDocument oDoc = new XPathDocument(oSMem);

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: XPathNavigator.SelectSingleNode(xpath) on space returns 0 leng
    ... I didn't see it for XPathDocument because the Stream ctor doesn't have that ... But I can use the Stream to create an XmlDocument, ... why does XPathDocument eat all of the whitespace? ...
    (microsoft.public.dotnet.xml)
  • Re: Problem with ICSharpCode.SharpZipLib.Zip
    ... > Some .Net Objects, for Example XPathDocument close stream after reading. ...
    (microsoft.public.dotnet.framework)
  • Re: Reading Simple Flatfiles with a COBOL Mindset
    ... I am new to C and old to COBOL ... > in with respect to reading a simple file - one record at a time. ... stream and impose your interpretation on them: ... there are text streams and binary streams. ...
    (comp.lang.c)
  • Re: Reading from standard input
    ... I finally understood the concept of '-' stream. ... I am learning perl scripting and was reading an online tutorial where i ... Can somebody explain me why reading from the standard input ...
    (comp.lang.perl.misc)
  • StreamReader.Read blocking?
    ... spawn threads that handle the reading of the streams by placing the stream ... Debug.WriteLine("Started reading standard output."); ... characters are read, or the end of the file is reached. ... About ReadBlock(), MSDN says: The method blocks until either count ...
    (microsoft.public.dotnet.framework)