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


C# ZipHelperStream.ReadByte方法代码示例

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


在下文中一共展示了ZipHelperStream.ReadByte方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
         {
             this._flags = (Flags) ((byte) stream2.ReadByte());
             if ((((byte) (this._flags & Flags.ModificationTime)) != 0) && (count >= 5))
             {
                 int seconds = stream2.ReadLEInt();
                 DateTime time = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 this._modificationTime = (time.ToUniversalTime() + new TimeSpan(0, 0, 0, seconds, 0)).ToLocalTime();
             }
             if (((byte) (this._flags & Flags.AccessTime)) != 0)
             {
                 int num2 = stream2.ReadLEInt();
                 DateTime time3 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 this._lastAccessTime = (time3.ToUniversalTime() + new TimeSpan(0, 0, 0, num2, 0)).ToLocalTime();
             }
             if (((byte) (this._flags & Flags.CreateTime)) != 0)
             {
                 int num3 = stream2.ReadLEInt();
                 DateTime time5 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 this._createTime = (time5.ToUniversalTime() + new TimeSpan(0, 0, 0, num3, 0)).ToLocalTime();
             }
         }
     }
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:28,代码来源:ExtendedUnixData.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))
			{
				// bit 0           if set, modification time is present
				// bit 1           if set, access time is present
				// bit 2           if set, creation time is present
				
				flags_ = (Flags)helperStream.ReadByte();
				if (((flags_ & Flags.ModificationTime) != 0) && (count >= 5))
				{
					int iTime = helperStream.ReadLEInt();

					modificationTime_ = (new System.DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime() +
						new TimeSpan(0, 0, 0, iTime, 0)).ToLocalTime();
				}

				if ((flags_ & Flags.AccessTime) != 0)
				{
					int iTime = helperStream.ReadLEInt();

					lastAccessTime_ = (new System.DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime() +
						new TimeSpan(0, 0, 0, iTime, 0)).ToLocalTime();
				}
				
				if ((flags_ & Flags.CreateTime) != 0)
				{
					int iTime = helperStream.ReadLEInt();

					createTime_ = (new System.DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime() +
						new TimeSpan(0, 0, 0, iTime, 0)).ToLocalTime();
				}
			}
		}
开发者ID:nagyist,项目名称:SparkleDotNET,代码行数:41,代码来源:ZipExtraData.cs


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