Home › Forums › .NET libraries › Xceed Zip & Real-Time Zip for .NET › 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
Imported from legacy forums. Posted by a (had 1074 views)
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.
byte  buffer = new byte [vStream.Length-1];
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)