Ejemplo n.º 1
0
 public byte[] GetData()
 {
     byte[] buffer;
     using (MemoryStream stream = new MemoryStream())
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             stream2.IsStreamOwner = false;
             stream2.WriteByte((byte)_flags);
             if (((byte)(_flags & Flags.ModificationTime)) != 0)
             {
                 DateTime time = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span = _modificationTime.ToUniversalTime() - time.ToUniversalTime();
                 int totalSeconds = (int)span.TotalSeconds;
                 stream2.WriteLeInt(totalSeconds);
             }
             if (((byte)(_flags & Flags.AccessTime)) != 0)
             {
                 DateTime time2 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span2 = _lastAccessTime.ToUniversalTime() - time2.ToUniversalTime();
                 int num2 = (int)span2.TotalSeconds;
                 stream2.WriteLeInt(num2);
             }
             if (((byte)(_flags & Flags.CreateTime)) != 0)
             {
                 DateTime time3 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span3 = _createTime.ToUniversalTime() - time3.ToUniversalTime();
                 int num3 = (int)span3.TotalSeconds;
                 stream2.WriteLeInt(num3);
             }
             buffer = stream.ToArray();
         }
     }
     return buffer;
 }
Ejemplo n.º 2
0
 public byte[] GetData()
 {
     byte[] buffer;
     using (MemoryStream stream = new MemoryStream())
     {
         using (ZipHelperStream stream2 = new ZipHelperStream(stream))
         {
             stream2.IsStreamOwner = false;
             stream2.WriteByte((byte)_flags);
             if (((byte)(_flags & Flags.ModificationTime)) != 0)
             {
                 DateTime time         = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span         = _modificationTime.ToUniversalTime() - time.ToUniversalTime();
                 int      totalSeconds = (int)span.TotalSeconds;
                 stream2.WriteLeInt(totalSeconds);
             }
             if (((byte)(_flags & Flags.AccessTime)) != 0)
             {
                 DateTime time2 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span2 = _lastAccessTime.ToUniversalTime() - time2.ToUniversalTime();
                 int      num2  = (int)span2.TotalSeconds;
                 stream2.WriteLeInt(num2);
             }
             if (((byte)(_flags & Flags.CreateTime)) != 0)
             {
                 DateTime time3 = new DateTime(0x7b2, 1, 1, 0, 0, 0);
                 TimeSpan span3 = _createTime.ToUniversalTime() - time3.ToUniversalTime();
                 int      num3  = (int)span3.TotalSeconds;
                 stream2.WriteLeInt(num3);
             }
             buffer = stream.ToArray();
         }
     }
     return(buffer);
 }
Ejemplo n.º 3
0
 public byte[] GetData()
 {
     byte[] buffer;
     using (var stream = new MemoryStream())
     {
         using (var stream2 = new ZipHelperStream(stream))
         {
             stream2.IsStreamOwner = false;
             stream2.WriteLeInt(0);
             stream2.WriteLeShort(1);
             stream2.WriteLeShort(0x18);
             stream2.WriteLeLong(_lastModificationTime.ToFileTime());
             stream2.WriteLeLong(_lastAccessTime.ToFileTime());
             stream2.WriteLeLong(_createTime.ToFileTime());
             buffer = stream.ToArray();
         }
     }
     return(buffer);
 }
Ejemplo n.º 4
0
 public byte[] GetData()
 {
     byte[] buffer;
     using (var stream = new MemoryStream())
     {
         using (var stream2 = new ZipHelperStream(stream))
         {
             stream2.IsStreamOwner = false;
             stream2.WriteLeInt(0);
             stream2.WriteLeShort(1);
             stream2.WriteLeShort(0x18);
             stream2.WriteLeLong(_lastModificationTime.ToFileTime());
             stream2.WriteLeLong(_lastAccessTime.ToFileTime());
             stream2.WriteLeLong(_createTime.ToFileTime());
             buffer = stream.ToArray();
         }
     }
     return buffer;
 }