本文整理汇总了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();
}
示例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);
}
示例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]);
}
示例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();
}