示例#1
0
        public async ValueTask <SignatureOptions> ReadHeader(CancellationToken ct)
        {
            var header = await _reader.Read <SignatureHeader>(ct).ConfigureAwait(false) ??
                         throw new FormatException($"expected {nameof(SignatureHeader)}; got EOF");

            return(header.Options);
        }
示例#2
0
        private async ValueTask ReadHeader(CancellationToken ct)
        {
            var header = await _reader.Read <DeltaHeader>(ct).ConfigureAwait(false);

            if (!header.HasValue)
            {
                throw new FormatException("failed to read delta header");
            }
        }