C# Class SipSharp.Transports.BufferPool

Keeps a pool of byte buffers.
A simple flyweight pattern to avoid frequent allocation of small buffers.
Afficher le fichier Open project: jgauffin/SipSharp

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
CreateBuffer ( ) : byte[]

Creates the buffer.

Method Details

BufferPool() public méthode

Initializes a new instance of the BufferPool class.
public BufferPool ( int bufferSize ) : System
bufferSize int How large buffers to allocate.
Résultat System

Dequeue() public méthode

Get a buffer.
Will create one if queue is empty.
public Dequeue ( ) : byte[]
Résultat byte[]

Enqueue() public méthode

Enqueues the specified buffer.
Buffer is is less than the minimum requirement.
public Enqueue ( byte buffer ) : void
buffer byte Buffer to enqueue.
Résultat void