Proton DotNet
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator Class Reference

An buffer allocator instance that creates heap based buffer objects. More...

Inheritance diagram for Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator:
Apache.Qpid.Proton.Buffer.IProtonBufferAllocator

Public Member Functions

IProtonBuffer OutputBuffer (long initialCapacity)
 Create a new output IProtonBuffer instance with the given initial capacity and the maximum capacity should be that of the underlying buffer implementations limit. The buffer implementation should support growing the buffer on an as needed basis to allow writes without the user needing to code extra capacity and buffer reallocation checks.
 
IProtonBuffer OutputBuffer (long initialCapacity, long maxCapacity)
 Create a new output IProtonBuffer instance with the given initial capacity and the maximum capacity should that of the value specified by the caller.
 
IProtonBuffer Allocate ()
 Create a new IProtonBuffer instance with default initial capacity. The buffer implementation should support growing the buffer on an as needed basis to allow writes without the user needing to code extra capacity and buffer reallocation checks.
 
IProtonBuffer Allocate (long initialCapacity)
 Create a new IProtonBuffer instance with the given initial capacity and the maximum capacity should be that of the underlying buffer implementations limit.
 
IProtonBuffer Allocate (long initialCapacity, long maxCapacity)
 Create a new IProtonBuffer instance with the given initial capacity and the maximum capacity should that of the value specified by the caller.
 
IProtonBuffer Wrap (byte[] buffer)
 Create a new IProtonBuffer that wraps the given byte array.
 
IProtonBuffer Wrap (byte[] buffer, int offset, int length)
 Create a new IProtonBuffer that wraps the given portion of the byte array.
 

Static Public Attributes

static readonly ProtonByteBufferAllocator Instance = new()
 

Detailed Description

An buffer allocator instance that creates heap based buffer objects.

Member Function Documentation

◆ Allocate() [1/3]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.Allocate ( )
inline

Create a new IProtonBuffer instance with default initial capacity. The buffer implementation should support growing the buffer on an as needed basis to allow writes without the user needing to code extra capacity and buffer reallocation checks.

It is not recommended that these buffers be backed by a pooled resource as there is no defined release point within the buffer API and if used by an AMQP engine they could be lost as buffers are copied or aggregated together.

Returns
A new buffer instance that allocates default capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.

◆ Allocate() [2/3]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.Allocate ( long  initialCapacity)
inline

Create a new IProtonBuffer instance with the given initial capacity and the maximum capacity should be that of the underlying buffer implementations limit.

It is not recommended that these buffers be backed by a pooled resource as there is no defined release point within the buffer API and if used by an AMQP engine they could be lost as buffers are copied or aggregated together.

Parameters
initialCapacityThe initial capacity to use when creating the buffer
Returns
A new buffer instance that has the given initial capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.

◆ Allocate() [3/3]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.Allocate ( long  initialCapacity,
long  maxCapacity 
)
inline

Create a new IProtonBuffer instance with the given initial capacity and the maximum capacity should that of the value specified by the caller.

It is not recommended that these buffers be backed by a pooled resource as there is no defined release point within the buffer API and if used by an AMQP engine they could be lost as buffers are copied or aggregated together.

Parameters
initialCapacityThe initial capacity to use when creating the buffer
maxCapacityThe maximum capacity limit for the newly created buffer
Returns
A new buffer instance that has the given initial capacity limits

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.

◆ OutputBuffer() [1/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.OutputBuffer ( long  initialCapacity)
inline

Create a new output IProtonBuffer instance with the given initial capacity and the maximum capacity should be that of the underlying buffer implementations limit. The buffer implementation should support growing the buffer on an as needed basis to allow writes without the user needing to code extra capacity and buffer reallocation checks.

The returned buffer will be used for frame output from the Proton engine and can be a pooled buffer which the IO handler will then need to release once the buffer has been written.

Parameters
initialCapacityThe initial capacity to use when creating the buffer
Returns
A new buffer instance that has the given initial capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.

◆ OutputBuffer() [2/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.OutputBuffer ( long  initialCapacity,
long  maxCapacity 
)
inline

Create a new output IProtonBuffer instance with the given initial capacity and the maximum capacity should that of the value specified by the caller.

The returned buffer will be used for frame output from the Proton engine and can be a pooled buffer which the IO handler will then need to release once the buffer has been written.

Parameters
initialCapacityThe initial capacity to use when creating the buffer
maxCapacityThe maximum capacity limit for the newly created buffer
Returns
A new buffer instance that has the given initial capacity limits

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.

◆ Wrap() [1/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.Wrap ( byte[]  array)
inline

Create a new IProtonBuffer that wraps the given byte array.

The capacity and maximum capacity for the resulting ProtonBuffer should equal to the length of the wrapped array and the returned array offset is zero.

Parameters
arrayThe byte array that will be wrapped
Returns
A new buffer instance that wraps the given byte array

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.

◆ Wrap() [2/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBufferAllocator.Wrap ( byte[]  array,
int  offset,
int  length 
)
inline

Create a new IProtonBuffer that wraps the given portion of the byte array.

The capacity and maximum capacity for the resulting ProtonBuffer should equal to the length of the wrapped array and the returned array offset is set by the caller.

Parameters
arrayThe byte array that will be wrapped
offsetThe offset into the byte array where the buffer starts
lengthThe length if the view into byte array that is accessible
Returns
A new buffer instance that wraps the given byte array

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAllocator.


The documentation for this class was generated from the following file: