本文整理匯總了C#中ProtoBuf.ProtoReader.ReadInt16方法的典型用法代碼示例。如果您正苦於以下問題:C# ProtoReader.ReadInt16方法的具體用法?C# ProtoReader.ReadInt16怎麽用?C# ProtoReader.ReadInt16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProtoBuf.ProtoReader
的用法示例。
在下文中一共展示了ProtoReader.ReadInt16方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ReadField
object ReadField(ProtoReader reader, Type memberT, string sClassName, CLS_Environment environment)
{
if (memberT == typeof(int))
{
return reader.ReadInt32();
}
else if (memberT == typeof(uint))
{
return reader.ReadUInt32();
}
else if (memberT == typeof(bool))
{
return reader.ReadBoolean();
}
else if (memberT == typeof(byte))
{
return reader.ReadByte();
}
else if (memberT == typeof(sbyte))
{
return reader.ReadSByte();
}
else if (memberT == typeof(float))
{
return reader.ReadSingle();
}
else if (memberT == typeof(double))
{
return reader.ReadDouble();
}
else if (memberT == typeof(short))
{
return reader.ReadInt16();
}
else if (memberT == typeof(ushort))
{
return reader.ReadUInt16();
}
else if (memberT == typeof(long))
{
return reader.ReadInt64();
}
else if (memberT == typeof(ulong))
{
return reader.ReadUInt64();
}
else if (memberT == typeof(string))
{
return reader.ReadString();
}
else if (memberT == typeof(byte[]))
{
return ProtoReader.AppendBytes(null, reader);
}
else if (memberT == typeof(SInstance))
{
SubItemToken st = ProtoReader.StartSubItem(reader);
CLS_Type_Class sClass = environment.GetTypeByKeywordQuiet(sClassName) as CLS_Type_Class;
if (!sClass.compiled)
RuntimeCompilerClass(sClassName);
CLS_Content content = CLS_Content.NewContent(environment);
CLS_Content.Value retVal = sClass.function.New(content, m_emptyParams);
CLS_Content.PoolContent(content);
SInstance sInstance = (SInstance)retVal.value;
ReadSInstance(reader, sInstance, environment);
ProtoReader.EndSubItem(st, reader);
return sInstance;
}
else
{
throw new NotImplementedException("未實現類型: " + memberT);
}
}