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


C# ZipHelperStream.WriteLEInt方法代码示例

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


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

示例1: GetData

 public byte[] GetData()
 {
     byte[] buffer;
     using (MemoryStream stream = new MemoryStream())
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             stream2.IsStreamOwner = false;
             stream2.WriteByte((byte) this._flags);
             if (((byte) (this._flags & Flags.ModificationTime)) != 0)
             {
                 DateTime time = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span = (TimeSpan) (this._modificationTime.ToUniversalTime() - time.ToUniversalTime());
                 int totalSeconds = (int) span.TotalSeconds;
                 stream2.WriteLEInt(totalSeconds);
             }
             if (((byte) (this._flags & Flags.AccessTime)) != 0)
             {
                 DateTime time2 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span2 = (TimeSpan) (this._lastAccessTime.ToUniversalTime() - time2.ToUniversalTime());
                 int num2 = (int) span2.TotalSeconds;
                 stream2.WriteLEInt(num2);
             }
             if (((byte) (this._flags & Flags.CreateTime)) != 0)
             {
                 DateTime time3 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span3 = (TimeSpan) (this._createTime.ToUniversalTime() - time3.ToUniversalTime());
                 int num3 = (int) span3.TotalSeconds;
                 stream2.WriteLEInt(num3);
             }
             buffer = stream.ToArray();
         }
     }
     return buffer;
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:35,代码来源:ExtendedUnixData.cs

示例2: GetData

 public byte[] GetData()
 {
     byte[] buffer;
     using (MemoryStream stream = new MemoryStream())
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             stream2.IsStreamOwner = false;
             stream2.WriteLEInt(0);
             stream2.WriteLEShort(1);
             stream2.WriteLEShort(0x18);
             stream2.WriteLELong(this._lastModificationTime.ToFileTime());
             stream2.WriteLELong(this._lastAccessTime.ToFileTime());
             stream2.WriteLELong(this._createTime.ToFileTime());
             buffer = stream.ToArray();
         }
     }
     return buffer;
 }
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:19,代码来源:NTTaggedData.cs

示例3: GetData

		/// <summary>
		/// Get the binary data representing this instance.
		/// </summary>
		/// <returns>The raw binary data representing this instance.</returns>
		public byte[] GetData()
		{
			using (MemoryStream ms = new MemoryStream())
			using (ZipHelperStream helperStream = new ZipHelperStream(ms))
			{
				helperStream.IsStreamOwner = false;
				helperStream.WriteLEInt(0);       // Reserved
				helperStream.WriteLEShort(1);     // Tag
				helperStream.WriteLEShort(24);    // Length = 3 x 8.
				helperStream.WriteLELong(lastModificationTime_.ToFileTime());
				helperStream.WriteLELong(lastAccessTime_.ToFileTime());
				helperStream.WriteLELong(createTime_.ToFileTime());
				return ms.ToArray();
			}
		}
开发者ID:nagyist,项目名称:SparkleDotNET,代码行数:19,代码来源:ZipExtraData.cs

示例4: GetData

 public byte[] GetData()
 {
     byte[] result;
     using (MemoryStream memoryStream = new MemoryStream())
     {
         using (ZipHelperStream zipHelperStream = new ZipHelperStream(memoryStream))
         {
             zipHelperStream.IsStreamOwner = false;
             zipHelperStream.WriteLEInt(0);
             zipHelperStream.WriteLEShort(1);
             zipHelperStream.WriteLEShort(24);
             zipHelperStream.WriteLELong(this._lastModificationTime.ToFileTime());
             zipHelperStream.WriteLELong(this._lastAccessTime.ToFileTime());
             zipHelperStream.WriteLELong(this._createTime.ToFileTime());
             result = memoryStream.ToArray();
         }
     }
     return result;
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:19,代码来源:NTTaggedData.cs

示例5: GetData

 /// <summary>
 /// Get the binary data representing this instance.
 /// </summary>
 /// <returns>The raw binary data representing this instance.</returns>
 public byte[] GetData() {
     using (var ms=new MemoryStream())
     using (var helperStream=new ZipHelperStream(ms)) {
         helperStream.IsStreamOwner=false;
         helperStream.WriteByte((byte)_flags); // Flags
         if ((_flags&Flags.ModificationTime)!=0) {
             TimeSpan span=_modificationTime.ToUniversalTime()-
                             new DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime();
             var seconds=(int)span.TotalSeconds;
             helperStream.WriteLEInt(seconds);
         }
         if ((_flags&Flags.AccessTime)!=0) {
             TimeSpan span=_lastAccessTime.ToUniversalTime()-
                             new DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime();
             var seconds=(int)span.TotalSeconds;
             helperStream.WriteLEInt(seconds);
         }
         if ((_flags&Flags.CreateTime)!=0) {
             TimeSpan span=_createTime.ToUniversalTime()-new DateTime(1970, 1, 1, 0, 0, 0).ToUniversalTime();
             var seconds=(int)span.TotalSeconds;
             helperStream.WriteLEInt(seconds);
         }
         return ms.ToArray();
     }
 }
开发者ID:fanfeilong,项目名称:exceltk,代码行数:29,代码来源:ZipExtraData.cs


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