C# Класс SipSharp.Transports.BufferPool

Keeps a pool of byte buffers.
A simple flyweight pattern to avoid frequent allocation of small buffers.
Показать файл Открыть проект

Открытые методы

Метод Описание
BufferPool ( int bufferSize ) : System

Initializes a new instance of the BufferPool class.

Dequeue ( ) : byte[]

Get a buffer.

Will create one if queue is empty.

Enqueue ( byte buffer ) : void

Enqueues the specified buffer.

Приватные методы

Метод Описание
CreateBuffer ( ) : byte[]

Creates the buffer.

Описание методов

BufferPool() публичный Метод

Initializes a new instance of the BufferPool class.
public BufferPool ( int bufferSize ) : System
bufferSize int How large buffers to allocate.
Результат System

Dequeue() публичный Метод

Get a buffer.
Will create one if queue is empty.
public Dequeue ( ) : byte[]
Результат byte[]

Enqueue() публичный Метод

Enqueues the specified buffer.
Buffer is is less than the minimum requirement.
public Enqueue ( byte buffer ) : void
buffer byte Buffer to enqueue.
Результат void