public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream stream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             _flags = (Flags)((byte)stream2.ReadByte());
             if ((((byte)(_flags & Flags.ModificationTime)) != 0) && (count >= 5))
             {
                 int seconds = stream2.ReadLeInt();
                 DateTime time = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 _modificationTime = (time.ToUniversalTime() + new TimeSpan(0, 0, 0, seconds, 0)).ToLocalTime();
             }
             if (((byte)(_flags & Flags.AccessTime)) != 0)
             {
                 int num2 = stream2.ReadLeInt();
                 DateTime time3 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 _lastAccessTime = (time3.ToUniversalTime() + new TimeSpan(0, 0, 0, num2, 0)).ToLocalTime();
             }
             if (((byte)(_flags & Flags.CreateTime)) != 0)
             {
                 int num3 = stream2.ReadLeInt();
                 DateTime time5 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 _createTime = (time5.ToUniversalTime() + new TimeSpan(0, 0, 0, num3, 0)).ToLocalTime();
             }
         }
     }
 }
 public void SetData(byte[] data, int index, int count)
 {
     using (MemoryStream stream = new MemoryStream(data, index, count, false))
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             _flags = (Flags)((byte)stream2.ReadByte());
             if ((((byte)(_flags & Flags.ModificationTime)) != 0) && (count >= 5))
             {
                 int      seconds = stream2.ReadLeInt();
                 DateTime time    = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 _modificationTime = (time.ToUniversalTime() + new TimeSpan(0, 0, 0, seconds, 0)).ToLocalTime();
             }
             if (((byte)(_flags & Flags.AccessTime)) != 0)
             {
                 int      num2  = stream2.ReadLeInt();
                 DateTime time3 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 _lastAccessTime = (time3.ToUniversalTime() + new TimeSpan(0, 0, 0, num2, 0)).ToLocalTime();
             }
             if (((byte)(_flags & Flags.CreateTime)) != 0)
             {
                 int      num3  = stream2.ReadLeInt();
                 DateTime time5 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 _createTime = (time5.ToUniversalTime() + new TimeSpan(0, 0, 0, num3, 0)).ToLocalTime();
             }
         }
     }
 }
Exemple #3
0
 public void SetData(byte[] data, int index, int count)
 {
     using (var stream = new MemoryStream(data, index, count, false))
     {
         using (var stream2 = new ZipHelperStream(stream))
         {
             stream2.ReadLeInt();
             while (stream2.Position < stream2.Length)
             {
                 var num  = stream2.ReadLeShort();
                 var num2 = stream2.ReadLeShort();
                 if (num == 1)
                 {
                     if (num2 >= 0x18)
                     {
                         var fileTime = stream2.ReadLeLong();
                         _lastModificationTime = DateTime.FromFileTime(fileTime);
                         var num4 = stream2.ReadLeLong();
                         _lastAccessTime = DateTime.FromFileTime(num4);
                         var num5 = stream2.ReadLeLong();
                         _createTime = DateTime.FromFileTime(num5);
                     }
                     return;
                 }
                 stream2.Seek(num2, SeekOrigin.Current);
             }
         }
     }
 }
Exemple #4
0
 public void SetData(byte[] data, int index, int count)
 {
     using (var stream = new MemoryStream(data, index, count, false))
     {
         using (var stream2 = new ZipHelperStream(stream))
         {
             stream2.ReadLeInt();
             while (stream2.Position < stream2.Length)
             {
                 var num = stream2.ReadLeShort();
                 var num2 = stream2.ReadLeShort();
                 if (num == 1)
                 {
                     if (num2 >= 0x18)
                     {
                         var fileTime = stream2.ReadLeLong();
                         _lastModificationTime = DateTime.FromFileTime(fileTime);
                         var num4 = stream2.ReadLeLong();
                         _lastAccessTime = DateTime.FromFileTime(num4);
                         var num5 = stream2.ReadLeLong();
                         _createTime = DateTime.FromFileTime(num5);
                     }
                     return;
                 }
                 stream2.Seek(num2, SeekOrigin.Current);
             }
         }
     }
 }