本文整理汇总了C#中System.IO.PacketReader.ReadValue方法的典型用法代码示例。如果您正苦于以下问题:C# PacketReader.ReadValue方法的具体用法?C# PacketReader.ReadValue怎么用?C# PacketReader.ReadValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: read_invoke_res
void read_invoke_res(PacketReader r, out ValueImpl v, out ValueImpl exc, out ValueImpl out_this, out ValueImpl[] out_args)
{
int resflags = r.ReadByte ();
v = null;
exc = null;
out_this = null;
out_args = null;
if (resflags == 0) {
exc = r.ReadValue ();
} else {
v = r.ReadValue ();
if ((resflags & 2) != 0)
out_this = r.ReadValue ();
if ((resflags & 4) != 0) {
int nargs = r.ReadInt ();
out_args = new ValueImpl [nargs];
for (int i = 0; i < nargs; ++i)
out_args [i] = r.ReadValue ();
}
}
}
示例2: ReadCattrs
CattrInfo[] ReadCattrs(PacketReader r)
{
CattrInfo[] res = new CattrInfo [r.ReadInt ()];
for (int i = 0; i < res.Length; ++i) {
CattrInfo info = new CattrInfo ();
info.ctor_id = r.ReadId ();
info.ctor_args = new ValueImpl [r.ReadInt ()];
for (int j = 0; j < info.ctor_args.Length; ++j) {
info.ctor_args [j] = r.ReadValue ();
}
info.named_args = new CattrNamedArgInfo [r.ReadInt ()];
for (int j = 0; j < info.named_args.Length; ++j) {
CattrNamedArgInfo arg = new CattrNamedArgInfo ();
int arg_type = r.ReadByte ();
arg.is_property = arg_type == 0x54;
arg.id = r.ReadId ();
arg.value = r.ReadValue ();
info.named_args [j] = arg;
}
res [i] = info;
}
return res;
}