コード例 #1
0
        internal static IdSpan ReadIdSpan <TReader>(this TReader @this) where TReader : IBinaryTokenStreamReader
        {
            var hashCode = @this.ReadInt();
            var len      = @this.ReadUShort();
            var bytes    = @this.ReadBytes(len);

            return(IdSpan.UnsafeCreate(bytes, hashCode));
        }
コード例 #2
0
ファイル: GrainId.cs プロジェクト: richorama/orleans
 /// <summary>
 /// Creates a new <see cref="GrainType"/> instance.
 /// </summary>
 private GrainId(SerializationInfo info, StreamingContext context)
 {
     Type = new GrainType(IdSpan.UnsafeCreate((byte[])info.GetValue("tv", typeof(byte[])), info.GetInt32("th")));
     Key  = IdSpan.UnsafeCreate((byte[])info.GetValue("kv", typeof(byte[])), info.GetInt32("kh"));
 }