Repository: dotnet/aspnetcore
File: src/Middleware/HttpLogging/src/ResponseBufferingStream.cs (C#)

Code before:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Buffers;
using System.IO.Pipelines;
using System.Text;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

namespace Microsoft.AspNetCore.HttpLogging;

internal sealed class ResponseBufferingStream : BufferingStream, IHttpResponseBodyFeature
{
    private IHttpResponseBodyFeature _innerBodyFeature = null!;
    private int _limit;
    private PipeWriter? _pipeAdapter;

    private HttpLoggingInterceptorContext _logContext = null!;
    private HttpLoggingOptions _options = null!;
    private IHttpLoggingInterceptor[] _interceptors = Array.Empty<IHttpLoggingInterceptor>();
    private bool _logBody;
    private bool _hasLogged;
    private Encoding? _encoding;
    private string? _bodyBeforeClose;

    private static readonly StreamPipeWriterOptions _pipeWriterOptions = new StreamPipeWriterOptions(leaveOpen: true);

    /// <summary>
    /// Parameterless constructor for object pooling.
    /// </summary>
    internal ResponseBufferingStream()
        : base(Stream.Null, NullLogger.Instance)
    {
    }

    /// <summary>
    /// Initializes the stream for a new request. Call this after obtaining from the pool.
    /// </summary>
    internal void Initialize(
        IHttpResponseBodyFeature innerBodyFeature,
        ILogger logger,
        HttpLoggingInterceptorContext logContext,
        HttpLoggingOptions options,
        IHttpLoggingInterceptor[] interceptors)
    {

Review comment (suggestion):
```suggestion
    private IHttpLoggingInterceptor[] _interceptors = [];
```

Code after:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Buffers;
using System.IO.Pipelines;
using System.Text;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

namespace Microsoft.AspNetCore.HttpLogging;

internal sealed class ResponseBufferingStream : BufferingStream, IHttpResponseBodyFeature
{
    private IHttpResponseBodyFeature _innerBodyFeature = null!;
    private int _limit;
    private PipeWriter? _pipeAdapter;

    private HttpLoggingInterceptorContext _logContext = null!;
    private HttpLoggingOptions _options = null!;
    private IHttpLoggingInterceptor[] _interceptors = [];
    private bool _logBody;
    private bool _hasLogged;
    private Encoding? _encoding;
    private string? _bodyBeforeClose;

    private static readonly StreamPipeWriterOptions _pipeWriterOptions = new StreamPipeWriterOptions(leaveOpen: true);

    /// <summary>
    /// Parameterless constructor for object pooling.
    /// </summary>
    internal ResponseBufferingStream()
        : base(Stream.Null, NullLogger.Instance)
    {
    }

    /// <summary>
    /// Initializes the stream for a new request. Call this after obtaining from the pool.
    /// </summary>
    internal void Initialize(
        IHttpResponseBodyFeature innerBodyFeature,
        ILogger logger,
        HttpLoggingInterceptorContext logContext,
        HttpLoggingOptions options,
        IHttpLoggingInterceptor[] interceptors)
    {