Exemplo n.º 1
0
        public static GetBlockHandle DeserializeGetBlockHandle(ReadOnlySpan <byte> message)
        {
            var editor  = new SpanBinaryReader(message);
            var header  = ParseMessageHeader(ref editor, GetBlockHandle.Info);
            var blockId = BlockId.Create(ref editor);

            return(new GetBlockHandle(header.RequestId, header.ClientId, blockId));
        }
Exemplo n.º 2
0
        public static CommitBlock DeserializeCommitBlock(ReadOnlySpan <byte> message)
        {
            var editor = new SpanBinaryReader(message);

            var header = ParseMessageHeader(ref editor, CommitBlock.Info);

            var blockHandle = new BlockAlias(editor.ReadUInt32());
            var blockId     = BlockId.Create(ref editor);

            return(new CommitBlock(header.RequestId, header.ClientId, blockHandle, blockId));
        }