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


C# IByteReader.Read方法代码示例

本文整理汇总了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();
		}
开发者ID:QuantozTechnology,项目名称:csharp-stellar-base,代码行数:12,代码来源:XdrEncoding.cs

示例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();
		}
开发者ID:QuantozTechnology,项目名称:csharp-stellar-base,代码行数:12,代码来源:XdrEncoding.cs

示例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();
		}
开发者ID:QuantozTechnology,项目名称:csharp-stellar-base,代码行数:16,代码来源:XdrEncoding.cs

示例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;
 }
开发者ID:QuantozTechnology,项目名称:csharp-stellar-base,代码行数:8,代码来源:XdrEncoding.cs


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