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