public static TypeReader GetReader(Type type) { Type baseType = Enum.GetUnderlyingType(type); var constructor = typeof(EnumTypeReader <>).MakeGenericType(baseType).GetTypeInfo().DeclaredConstructors.First(); return((TypeReader)constructor.Invoke(new object[] { type, PrimitiveParsers.Get(baseType) })); }
public int SerializeLong2() { PrimitiveParsers.WriteInt64Unsafe(Value, Space, true); return(sizeof(long)); }