Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Open stream archive

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20293 |

    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

    Imported from legacy forums. Posted by a (had 1074 views)

    Xceed Support
    Member
    Post count: 5658

    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);

     

    Imported from legacy forums. Posted by Mohamed [Xceed] (had 992 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.