Yes. The best way to do it would be to create a StreamFile around your stream and call the StreamFile’s CopyTo method. For example:
byte[] data = System.Text.Encoding.Default.GetBytes( “This is the data in the sql db” );
using( MemoryStream stream = new MemoryStream( data ) ) { StreamFile file = new StreamFile( stream ); file.Name = “file.ext”;
ZipArchive zip = new ZipArchive( new DiskFile( @”d:\test.exe” ) ); zip.BeginUpdate();
XceedSfxPrefix sfx = new XceedSfxPrefix( new DiskFile( @”C:\Program Files\Xceed Components\Xceed Zip Compression Library 5.0\Sfx\xcdsfx32.bin” ) );
zip.SfxPrefix = sfx;
file.CopyTo( zip, true ); zip.EndUpdate(); } |
Imported from legacy forums. Posted by Xceed admin (had 2205 views)