private (string securityToken, DateTime leaseEnd) DecodePayload(ReadOnlySpan <byte> span)
        {
            var reader        = new BinarySpanReader(span);
            var securityToken = reader.ReadString();
            var leaseEnd      = new DateTime(reader.ReadInt64());

            return(securityToken, leaseEnd);
        }
示例#2
0
        private static DebugModuleProperties Decode(ReadOnlySpan <byte> memory)
        {
            var reader       = new BinarySpanReader(memory, ByteOrder.LittleEndian);
            var endPoint     = new EndPointAddress(reader.Read().ToArray()); // TODO: This copies
            var module       = new ModuleIdentifier(reader.ReadString());
            var major        = reader.ReadInt32();
            var minor        = reader.ReadInt32();
            var revision     = reader.ReadInt32();
            var isPreRelease = reader.ReadBool();
            var version      = new ModuleVersion(major, minor, revision, isPreRelease);

            return(new DebugModuleProperties(endPoint, module, version));
        }
示例#3
0
        private (EndPointAddress endPoint, IReadOnlyCollection <ReadOnlyMemory <char> > prefixes) ReadRunningModuleEntry(IEntry entry)
        {
            var reader        = new BinarySpanReader(entry.Value.Span, ByteOrder.LittleEndian);
            var endPoint      = ReadEndPointAddress(ref reader);
            var prefixesCount = reader.ReadInt32();

            var prefixes = new List <ReadOnlyMemory <char> >(capacity: prefixesCount);

            for (var i = 0; i < prefixesCount; i++)
            {
                var prefix = reader.ReadString().AsMemory();
                prefixes.Add(prefix);
            }

            return(endPoint, prefixes);
        }