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


C# ZipHelperStream.Seek方法代码示例

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


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

示例1: SetData

 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream stream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             stream2.ReadLEInt();
             while (stream2.Position < stream2.Length)
             {
                 int num = stream2.ReadLEShort();
                 int num2 = stream2.ReadLEShort();
                 if (num == 1)
                 {
                     if (num2 >= 0x18)
                     {
                         long fileTime = stream2.ReadLELong();
                         this._lastModificationTime = DateTime.FromFileTime(fileTime);
                         long num4 = stream2.ReadLELong();
                         this._lastAccessTime = DateTime.FromFileTime(num4);
                         long num5 = stream2.ReadLELong();
                         this._createTime = DateTime.FromFileTime(num5);
                     }
                     return;
                 }
                 stream2.Seek((long) num2, SeekOrigin.Current);
             }
         }
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:29,代码来源:NTTaggedData.cs

示例2: SetData

		/// <summary>
		/// Set the data from the raw values provided.
		/// </summary>
		/// <param name="data">The raw data to extract values from.</param>
		/// <param name="index">The index to start extracting values from.</param>
		/// <param name="count">The number of bytes available.</param>
		public void SetData(byte[] data, int index, int count)
		{
			using (MemoryStream ms = new MemoryStream(data, index, count, false)) 
			using (ZipHelperStream helperStream = new ZipHelperStream(ms))
			{
				helperStream.ReadLEInt(); // Reserved
				while (helperStream.Position < helperStream.Length)
				{
					int ntfsTag = helperStream.ReadLEShort();
					int ntfsLength = helperStream.ReadLEShort();
					if (ntfsTag == 1)
					{
						if (ntfsLength >= 24)
						{
							long lastModificationTicks = helperStream.ReadLELong();
							lastModificationTime_ = DateTime.FromFileTime(lastModificationTicks);

							long lastAccessTicks = helperStream.ReadLELong();
							lastAccessTime_ = DateTime.FromFileTime(lastAccessTicks);

							long createTimeTicks = helperStream.ReadLELong();
							createTime_ = DateTime.FromFileTime(createTimeTicks);
						}
						break;
					}
					else
					{
						// An unknown NTFS tag so simply skip it.
						helperStream.Seek(ntfsLength, SeekOrigin.Current);
					}
				}
			}
		}
开发者ID:nagyist,项目名称:SparkleDotNET,代码行数:39,代码来源:ZipExtraData.cs

示例3: SetData

 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream memoryStream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream zipHelperStream = new ZipHelperStream(memoryStream))
         {
             zipHelperStream.ReadLEInt();
             while (zipHelperStream.Position < zipHelperStream.Length)
             {
                 int num = zipHelperStream.ReadLEShort();
                 int num2 = zipHelperStream.ReadLEShort();
                 if (num == 1)
                 {
                     if (num2 >= 24)
                     {
                         long fileTime = zipHelperStream.ReadLELong();
                         this._lastModificationTime = DateTime.FromFileTime(fileTime);
                         long fileTime2 = zipHelperStream.ReadLELong();
                         this._lastAccessTime = DateTime.FromFileTime(fileTime2);
                         long fileTime3 = zipHelperStream.ReadLELong();
                         this._createTime = DateTime.FromFileTime(fileTime3);
                     }
                     break;
                 }
                 zipHelperStream.Seek((long)num2, SeekOrigin.Current);
             }
         }
     }
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:29,代码来源:NTTaggedData.cs


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