Esempio n. 1
0
 public override object StartMemPack(MemPackOptions options, string fileName)
 {
     archiveFile  = fileName;
     sb           = new StringBuilder();
     totalTaken   = 0;
     totalWritten = 0;
     return(sb);
 }
Esempio n. 2
0
        public static IntPtr StartMemPackW(int options, [MarshalAs(UnmanagedType.LPWStr)] string fileName)
        {
            IntPtr         result    = IntPtr.Zero;
            MemPackOptions mpOptions = (MemPackOptions)options;

            callSignature = String.Format("StartMemPack {0} ({1})", fileName, mpOptions.ToString());
            try {
                object o = Plugin.StartMemPack(mpOptions, fileName);
                if (o != null)
                {
                    result = TcHandles.AddHandle(o);
                }

                TraceCall(TraceLevel.Warning, (result == IntPtr.Zero) ? "ERROR" : result.ToString());
            } catch (Exception ex) {
                ProcessException(ex);
            }
            return(result);
        }
Esempio n. 3
0
        public override object StartMemPack(MemPackOptions options, string fileName)
        {
            archiveFile = fileName;
            byte[] zipBuff = new byte[BlockSize];

            MemoryStream memStream = new MemoryStream();

            memStream.Write(zipBuff, 0, zipBuff.Length);

            ZipOutputStream zip = new ZipOutputStream(memStream);

            zip.SetLevel(6);
            fileName = Path.GetFileNameWithoutExtension(fileName);
            ZipEntry entry = new ZipEntry(fileName)
            {
                DateTime = DateTime.Now
            };

            zip.PutNextEntry(entry);
            totalWritten = zip.Position;
            return(zip);
        }
Esempio n. 4
0
 public virtual object StartMemPack(MemPackOptions options, string fileName)
 {
     return(null);
 }