public override void Write(byte[] buffer, int offset, int count) { MemoryStream.Write(buffer, offset, count); _ = PacketDebug.AppendAsync("", MemoryStream.ToArray()); MemoryStream = new MemoryStream(); BaseStream.Write(buffer, offset, count); }
public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { await MemoryStream.WriteAsync(buffer, offset, count, cancellationToken); await PacketDebug.AppendAsync("", MemoryStream.ToArray()); MemoryStream = new MemoryStream(); await BaseStream.WriteAsync(buffer, offset, count, cancellationToken); }