当前位置: 首页>>代码示例>>C#>>正文


C# ZipEntry.Clone方法代码示例

本文整理汇总了C#中ICSharpCode.SharpZipLib.Zip.ZipEntry.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# ZipEntry.Clone方法的具体用法?C# ZipEntry.Clone怎么用?C# ZipEntry.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICSharpCode.SharpZipLib.Zip.ZipEntry的用法示例。


在下文中一共展示了ZipEntry.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ZipUpdate

			public ZipUpdate(UpdateCommand command, ZipEntry entry)
			{
				command_ = command;
				entry_ = ( ZipEntry )entry.Clone();
			}
开发者ID:jamesbascle,项目名称:SharpZipLib,代码行数:5,代码来源:ZipFile.cs

示例2: Cloning

        public void Cloning()
        {
            long testCrc = 3456;
            long testSize = 99874276;
            long testCompressedSize = 72347;
            byte[] testExtraData = new byte[] { 0x00, 0x01, 0x00, 0x02, 0x0EF, 0xFE };
            string testName = "Namu";
            int testFlags = 4567;
            long testDosTime = 23434536;
            CompressionMethod testMethod = CompressionMethod.Deflated;

            string testComment = "A comment";

            ZipEntry source = new ZipEntry(testName);
            source.Crc = testCrc;
            source.Comment = testComment;
            source.Size = testSize;
            source.CompressedSize = testCompressedSize;
            source.ExtraData = testExtraData;
            source.Flags = testFlags;
            source.DosTime = testDosTime;
            source.CompressionMethod = testMethod;

            ZipEntry clone = (ZipEntry)source.Clone();

            // Check values against originals
            Assert.AreEqual(testName, clone.Name, "Cloned name mismatch");
            Assert.AreEqual(testCrc, clone.Crc, "Cloned crc mismatch");
            Assert.AreEqual(testComment, clone.Comment, "Cloned comment mismatch");
            Assert.AreEqual(testExtraData, clone.ExtraData, "Cloned Extra data mismatch");
            Assert.AreEqual(testSize, clone.Size, "Cloned size mismatch");
            Assert.AreEqual(testCompressedSize, clone.CompressedSize, "Cloned compressed size mismatch");
            Assert.AreEqual(testFlags, clone.Flags, "Cloned flags mismatch");
            Assert.AreEqual(testDosTime, clone.DosTime, "Cloned DOSTime mismatch");
            Assert.AreEqual(testMethod, clone.CompressionMethod, "Cloned Compression method mismatch");

            // Check against source
            PiecewiseCompare(source, clone);
        }
开发者ID:firestrand,项目名称:SharpZipLib,代码行数:39,代码来源:ZipTests.cs

示例3: IsDataUnique

        public void IsDataUnique()
        {
            ZipEntry a = new ZipEntry("Basil");
            byte[] extra = new byte[4];
            extra[0] = 27;
            a.ExtraData = extra;

            ZipEntry b = (ZipEntry)a.Clone();
            b.ExtraData[0] = 89;
            Assert.IsTrue(b.ExtraData[0] != a.ExtraData[0], "Extra data not unique " + b.ExtraData[0] + " " + a.ExtraData[0]);

            ZipEntry c = (ZipEntry)a.Clone();
            c.ExtraData[0] = 45;
            Assert.IsTrue(a.ExtraData[0] != c.ExtraData[0], "Extra data not unique " + a.ExtraData[0] + " " + c.ExtraData[0]);
        }
开发者ID:firestrand,项目名称:SharpZipLib,代码行数:15,代码来源:ZipTests.cs

示例4: ZipUpdate

 public ZipUpdate(ZipFile.UpdateCommand command, ZipEntry entry)
 {
     this.sizePatchOffset_ = -1L;
     this.crcPatchOffset_ = -1L;
     this._offsetBasedSize = -1L;
     this.command_ = command;
     this.entry_ = (ZipEntry) entry.Clone();
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:8,代码来源:ZipFile.cs


注:本文中的ICSharpCode.SharpZipLib.Zip.ZipEntry.Clone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。