1 instantiation of BufferWriter
Microsoft.Extensions.Http.Diagnostics (1)
src\Shared\BufferWriterPool\BufferWriterPooledObjectPolicy.cs (1)
54public override BufferWriter<T> Create() => new();
20 references to BufferWriter
Microsoft.Extensions.Http.Diagnostics (20)
Logging\Internal\HttpRequestBodyReader.cs (2)
31private static readonly ObjectPool<BufferWriter<byte>> _bufferWriterPool = BufferWriterPool.SharedBufferWriterPool; 97var bufferWriter = _bufferWriterPool.Get();
Logging\Internal\HttpResponseBodyReader.cs (2)
25private static readonly ObjectPool<BufferWriter<byte>> _bufferWriterPool = BufferWriterPool.SharedBufferWriterPool; 70var bufferWriter = _bufferWriterPool.Get();
src\Shared\BufferWriterPool\BufferWriter.cs (1)
88/// You must reset the <see cref="BufferWriter{T}"/> before trying to re-use it.
src\Shared\BufferWriterPool\BufferWriterPool.cs (5)
20/// Creates an object pool of <see cref="BufferWriter{T}"/> instances. 26public static ObjectPool<BufferWriter<T>> CreateBufferWriterPool<T>(int maxCapacity = DefaultCapacity, int maxBufferWriterCapacity = DefaultMaxBufferWriterCapacity) 31return PoolFactory.CreatePool<BufferWriter<T>>(new BufferWriterPooledObjectPolicy<T>(maxBufferWriterCapacity), maxCapacity); 35/// Gets the shared pool of <see cref="BufferWriter{T}"/> instances. 37public static ObjectPool<BufferWriter<byte>> SharedBufferWriterPool { get; } = CreateBufferWriterPool<byte>();
src\Shared\BufferWriterPool\BufferWriterPooledObjectPolicy.cs (7)
12/// An object pooling policy designed for <see cref="BufferWriter{T}"/>. 20internal sealed class BufferWriterPooledObjectPolicy<T> : PooledObjectPolicy<BufferWriter<T>> 31/// The maximum capacity of <see cref="BufferWriter{T}"/> to keep in the pool. 41/// Gets the maximum capacity of <see cref="BufferWriter{T}"/> to keep in the pool. 51/// Creates an instance of <see cref="BufferWriter{T}"/>. 54public override BufferWriter<T> Create() => new(); 61public override bool Return(BufferWriter<T> obj)
src\Shared\BufferWriterPool\ReturnableBufferWriter.cs (3)
20private readonly ObjectPool<BufferWriter<T>> _pool; 26public ReturnableBufferWriter(ObjectPool<BufferWriter<T>> pool) 35public BufferWriter<T> Buffer { get; }