Show / Hide Table of Contents

    Class DefaultBufferPool

    A concrete IBufferPool implementation using a thread-safe stack. Works well when all consumers ask for buffers with the same size. If your application would use variable size buffers consider implementing IBufferPool using System.Buffers library from Microsoft.

    Inheritance
    Object
    DefaultBufferPool
    Implements
    IBufferPool
    IDisposable
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: StreamExtended
    Assembly: StreamExtended.dll
    Syntax
    public class DefaultBufferPool : IBufferPool, IDisposable

    Methods

    Dispose()

    Declaration
    public void Dispose()

    GetBuffer(Int32)

    Gets a buffer.

    Declaration
    public byte[] GetBuffer(int bufferSize)
    Parameters
    Type Name Description
    Int32 bufferSize

    Size of the buffer.

    Returns
    Type Description
    Byte[]

    ReturnBuffer(Byte[])

    Returns the buffer.

    Declaration
    public void ReturnBuffer(byte[] buffer)
    Parameters
    Type Name Description
    Byte[] buffer

    The buffer.

    Implements

    IBufferPool
    System.IDisposable
    Back to top Generated by DocFX