Exemplo n.º 1
0
        public static TypeKey ReadTypeKey(BinaryTokenStreamReader reader)
        {
            var hashCode = reader.ReadInt();
            var count    = reader.ReadUShort();
            var typeName = reader.ReadBytes(count);

            return(new TypeKey(hashCode, typeName));
        }
Exemplo n.º 2
0
        private Type ReadNamedType(BinaryTokenStreamReader reader)
        {
            var hashCode = reader.ReadInt();
            var count    = reader.ReadUShort();
            var typeName = reader.ReadBytes(count);

            return(this.typeKeyCache.GetOrAdd(
                       new TypeKey(hashCode, typeName),
                       k => Type.GetType(Encoding.UTF8.GetString(k.TypeName), throwOnError: true)));
        }