Welcome to the Xceed Community | Help
Community Search  
More Search Options

Open stream archive

Sort Posts: Previous Next
  •  02-21-2010, 4:47 PM Post no. 25879

    Open stream archive

    How you open a stream containing a zip archive.

    So far, I've tried the following but to no avail:

    Public Sub Open(ByVal vStream As IO.Stream)

            Dim pMF As MemoryFile
            Dim pBytes() As Byte

            pMF = New MemoryFile()
            ReDim pBytes(vStream.Length - 1)
            vStream.Read(pBytes, 0, pBytes.Length)
            pMF.CreateWrite.Write(pBytes, 0, pBytes.Length)
            mZip = New ZipArchive(pMF)
            mZip.BeginUpdate()
            mFilename = Nothing

        End Sub

  •  03-09-2010, 3:19 PM Post no. 26042 in reply to 25879

    Re: Open stream archive

    Hi,

     

    After reading the stream content into the pBytes buffer, you could open another stream onto the newly created MemoryFile and then do a write into it using the buffer.

     

    For example:

                       ...

      byte [] buffer = new byte [vStream.Length-1];

            vStream.Read(buffer,0,buffer.Length);

           

            MemoryFile pMF = new MemoryFile();

            Stream stream = pMF.OpenWrite(true, FileShare.ReadWrite);

            stream.BeginWrite(buffer, 0, buffer.Length, null, null);

      ...


    Xceed - Software Developer and Technical Support
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.