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)); }
/// <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")); }