protected override async Task InitializeAsync(IMessageBufferReader reader, CancellationToken cancellationToken) { await base.InitializeAsync(reader, cancellationToken); ReadCount = await reader.PushShortFromStreamAsync(cancellationToken); WriteOffset = await reader.PushShortFromStreamAsync(cancellationToken); WriteCount = await reader.PushShortFromStreamAsync(cancellationToken); var byteCount = await reader.PushByteFromStreamAsync(cancellationToken); await reader.PushFromStreamAsync(byteCount, cancellationToken); MessageBuffer = new MessageBufferSpan(reader.Buffer, (ushort)(reader.Buffer.Length - byteCount - 2), byteCount); }
protected override async Task InitializeAsync(IMessageBufferReader reader, CancellationToken cancellationToken) { Offset = await reader.PushShortFromStreamAsync(cancellationToken); Count = await reader.PushShortFromStreamAsync(cancellationToken); }
protected override async Task InitializeAsync(IMessageBufferReader reader, CancellationToken cancellationToken) { await base.InitializeAsync(reader, cancellationToken); Value = await reader.PushShortFromStreamAsync(cancellationToken); }