本文整理汇总了C#中IByteReader.Read方法的典型用法代码示例。如果您正苦于以下问题:C# IByteReader.Read方法的具体用法?C# IByteReader.Read怎么用?C# IByteReader.Read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IByteReader
的用法示例。
在下文中一共展示了IByteReader.Read方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DecodeUInt32
/// <summary>
/// Decodes the UInt32.
/// http://tools.ietf.org/html/rfc4506#section-4.2
/// </summary>
public static uint DecodeUInt32(IByteReader r)
{
return
((uint)r.Read() << 0x18) |
((uint)r.Read() << 0x10) |
((uint)r.Read() << 0x08) |
(uint)r.Read();
}
示例2: DecodeInt32
/// <summary>
/// Decodes the Int32.
/// http://tools.ietf.org/html/rfc4506#section-4.1
/// </summary>
public static int DecodeInt32(IByteReader r)
{
return
(r.Read() << 0x18) |
(r.Read() << 0x10) |
(r.Read() << 0x08) |
r.Read();
}
示例3: DecodeInt64
/// <summary>
/// Decodes the Int64.
/// http://tools.ietf.org/html/rfc4506#section-4.5
/// </summary>
public static long DecodeInt64(IByteReader r)
{
return
((long)r.Read() << 56) |
((long)r.Read() << 48) |
((long)r.Read() << 40) |
((long)r.Read() << 32) |
((long)r.Read() << 24) |
((long)r.Read() << 16) |
((long)r.Read() << 8) |
(long)r.Read();
}
示例4: ReadFixOpaque
public static byte[] ReadFixOpaque(IByteReader r, uint len)
{
byte[] result = r.Read(len);
uint tail = len % 4u;
if (tail != 0)
r.Read(4u - tail);
return result;
}