本文整理汇总了C#中ILittleEndianInput.ReadLong方法的典型用法代码示例。如果您正苦于以下问题:C# ILittleEndianInput.ReadLong方法的具体用法?C# ILittleEndianInput.ReadLong怎么用?C# ILittleEndianInput.ReadLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILittleEndianInput
的用法示例。
在下文中一共展示了ILittleEndianInput.ReadLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadBoolean
private static Object ReadBoolean(ILittleEndianInput in1)
{
byte val = (byte)in1.ReadLong(); // 7 bytes 'not used'
switch (val)
{
case FALSE_ENCODING:
return false;
case TRUE_ENCODING:
return true;
}
// Don't tolerate Unusual bool encoded values (unless it becomes evident that they occur)
throw new Exception("unexpected bool encoding (" + val + ")");
}
示例2: ReadAConstantValue
private static object ReadAConstantValue(ILittleEndianInput in1)
{
byte grbit = (byte)in1.ReadByte();
switch (grbit)
{
case TYPE_EMPTY:
in1.ReadLong(); // 8 byte 'not used' field
return EMPTY_REPRESENTATION;
case TYPE_NUMBER:
return in1.ReadDouble();
case TYPE_STRING:
return StringUtil.ReadUnicodeString(in1);
case TYPE_BOOLEAN:
return ReadBoolean(in1);
case TYPE_ERROR_CODE:
int errCode = in1.ReadUShort();
// next 6 bytes are Unused
in1.ReadUShort();
in1.ReadInt();
return ErrorConstant.ValueOf(errCode);
}
throw new Exception("Unknown grbit value (" + grbit + ")");
}
示例3: GUID
public GUID(ILittleEndianInput in1)
:this(in1.ReadInt(), in1.ReadUShort(), in1.ReadUShort(), in1.ReadLong())
{
}