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

A proton buffer implementation that wraps a single heap allocated byte array and provides read and write operations on that array along with self resizing based on capacity limits. More...

Inheritance diagram for Apache.Qpid.Proton.Buffer.ProtonByteBuffer:
Apache.Qpid.Proton.Buffer.IProtonBuffer Apache.Qpid.Proton.Buffer.IReadableComponent Apache.Qpid.Proton.Buffer.IWritableComponent Apache.Qpid.Proton.Buffer.IProtonBufferAccessors

Public Member Functions

 ProtonByteBuffer ()
 Create a new proton byte buffer instance with default initial capacity and limited only by the size of a byte array in max capacity.
 
 ProtonByteBuffer (long initialCapacity)
 Create a new proton byte buffer instance with given initial capacity and limited only by the size of a byte array in max capacity.
 
 ProtonByteBuffer (long initialCapacity, long maxCapacity)
 Create a new proton byte buffer instance with given initial capacity and limited to a max capacity of the given amount.
 
 ProtonByteBuffer (byte[] backingArray)
 Create a new proton byte buffer instance with given backing array whose size determines that largest the buffer can ever be.
 
 ProtonByteBuffer (byte[] backingArray, long maxCapacity)
 Create a new proton byte buffer instance with given backing array as the starting backing store and uses the provided max capacity value to control how large the buffer could ever grow.
 
 ProtonByteBuffer (byte[] backingArray, int arrayOffset, long maxCapacity)
 Create a new proton byte buffer instance with given backing array as the starting backing store and uses the provided max capacity value to control how large the buffer could ever grow.
 
 ProtonByteBuffer (byte[] backingArray, int arrayOffset, int capacity, long maxCapacity)
 Create a new proton byte buffer instance with given backing array as the starting backing store and uses the provided max capacity value to control how large the buffer could ever grow.
 
IProtonBuffer EnsureWritable (long amount)
 Requests that the buffer ensure that there is enough allocated internal capacity such that the given number of bytes can be written without requiring additional allocations and that this amount does not exceed any total capacity restrictions for this buffer.
 
IProtonBuffer Compact ()
 Discards the read bytes, and moves the buffer contents to the beginning of the buffer.
 
IProtonBuffer Reclaim ()
 Reclaims read buffer space and returns it to the operating system or other pooling mechanisms if those are in place, then compacts the remaining buffer contents. For a non-composite buffer this operation could consist of allocating a smaller buffer to house any remaining unread bytes and freeing the larger backing buffer in some cases or it may result in a no-op depending on the buffer implementation. For the composite buffer case this operation provides an API which allows for fully read buffer constituents to be released and returned to a memory pool or back to the O/S.
 
IProtonBuffer WriteSplit (long offset)
 Splits the buffer into two distinct buffers at the given index plus the current write offset. The returned buffer will retain the read offset and write offset of this buffer but will be truncated to match the capacity provided by the split index, which implies that they might both be set to the capacity if they were previously set to the split index. The returned buffer will set its read and write offsets to zero if they fell prior to the given index otherwise they will be truncated to match the new buffer capacity. Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.
 
IProtonBuffer ReadSplit (long offset)
 Splits the buffer into two distinct buffers at the given index plus the current read offset. The returned buffer will retain the read offset and write offset of this buffer but will be truncated to match the capacity provided by the split index, which implies that they might both be set to the capacity if they were previously set beyond the split index. The returned buffer will set its read and write offsets to zero if they fell prior to the given index otherwise they will be truncated to match the new buffer capacity. Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.
 
IProtonBuffer Split ()
 Splits the buffer into two buffers at the write offset. The resulting buffer will comprise the read and readable portions of this buffer with the write offset and capacity set to the current write offset. This buffer will lose access to the split region and its read offset will be set to the current write offset. This buffer will also have its capacity reduced by the number of bytes in the returned buffer (i.e. the current number of read and readable bytes). Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.
 
IProtonBuffer Split (long offset)
 Splits the buffer into two distinct buffers at the given index. The returned buffer will retain the read offset and write offset of this buffer but will be truncated to match the capacity provided by the split index, which implies that they might both be set to the capacity if they were previously set beyond the split index. The returned buffer will set its read and write offsets to zero if they fell prior to the given index otherwise they will be truncated to match the new buffer capacity. Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.
 
IProtonBuffer Reset ()
 Resets the read and write offset values to zero.
 
IProtonBuffer SkipBytes (long amount)
 Advance the buffer read offset by the specified amount effectively skipping that number of bytes from being read.
 
IProtonBuffer Fill (byte value)
 Fill the buffer with the given byte value. This method does not respect the read offset nor the write offset but instead fills the entire backing buffer memory with the given value.
 
IProtonBuffer Copy ()
 Returns a copy of this buffer's readable bytes. Modifying the content of the returned buffer will not affect this buffers contents. The two buffers will maintain separate offsets. The returned copy has the write offset set to the length of the copy meaning that the entire copied region is read for reading.
 
IProtonBuffer Copy (long index, long length)
 Returns a copy of this buffer's readable bytes. Modifying the content of the returned buffer will not affect this buffers contents. The two buffers will maintain separate offsets. The amount and start of the data to be copied is provided by the index and length arguments. The returned copy has the write offset set to the length of the copy meaning that the entire copied region is read for reading.
 
IProtonBuffer CopyInto (long srcPos, byte[] dest, long destPos, long length)
 Copies the given number of bytes from this buffer into the target byte buffer starting the read from the given position in this buffer and the write to at the given position in the destination buffer. The length parameter controls how many bytes are copied to the destination. This method does not modify the read or write offset values in this buffer.
 
IProtonBuffer CopyInto (long srcPos, IProtonBuffer dest, long destPos, long length)
 Copies the given number of bytes from this buffer into the target byte buffer starting the read from the given position in this buffer and the write to at the given position in the destination buffer. The length parameter controls how many bytes are copied to the destination. This method does not modify the read or write offset values in this buffer nor those of the destination buffer. The destination write index is an absolute index value unrelated to the write offset of the target.
 
int ForEachReadableComponent (in int index, in Func< int, IReadableComponent, bool > processor)
 Invokes the provided delegate for each readable component in this buffer and increments the provided index value for each invocation. The total number of buffers processed is returned to the caller. The delegate can stop processing at any time by returning false in which case this method will stop and return a negative value to indicate that processing stopped early and did not traverse all available components.
 
int ForEachWritableComponent (in int index, in Func< int, IWritableComponent, bool > processor)
 Invokes the provided delegate for each writable component in this buffer and increments the provided index value for each invocation. The total number of buffers processed is returned to the caller. The delegate can stop processing at any time by returning false in which case this method will stop and return a negative value to indicate that processing stopped early and did not traverse all available components.
 
bool GetBoolean (long index)
 Reads a single byte from the given index and returns a boolean value indicating if the byte was zero (false) or greater than zero (true).
 
sbyte GetByte (long index)
 Reads a single signed byte from the given index and returns it.
 
char GetChar (long index)
 Reads a single 2 byte char from the given index and returns it.
 
double GetDouble (long index)
 Reads a single 8 byte double from the given index and returns it.
 
float GetFloat (long index)
 Reads a single 4 byte float from the given index and returns it.
 
int GetInt (long index)
 Reads a single 4 byte int from the given index and returns it.
 
long GetLong (long index)
 Reads a single 8 byte long from the given index and returns it.
 
short GetShort (long index)
 Reads a single 2 byte short from the given index and returns it.
 
byte GetUnsignedByte (long index)
 Reads a single unsigned byte from the given index and returns it.
 
uint GetUnsignedInt (long index)
 Reads a single 4 byte unsigned int from the given index and returns it.
 
ulong GetUnsignedLong (long index)
 Reads a single 8 byte unsigned long from the given index and returns it.
 
ushort GetUnsignedShort (long index)
 Reads a single 2 byte unsigned short from the given index and returns it.
 
bool ReadBoolean ()
 Reads the next byte from the buffer and returns the boolean value.
 
sbyte ReadByte ()
 Read a signed byte from the buffer and advance the read offset.
 
char ReadChar ()
 Reads the two bytes from the buffer and returns the char value.
 
double ReadDouble ()
 Reads the next eight bytes from the buffer and returns the double value.
 
float ReadFloat ()
 Reads the next four bytes from the buffer and returns the float value.
 
int ReadInt ()
 Reads the next four bytes from the buffer and returns the int value.
 
long ReadLong ()
 Reads the next eight bytes from the buffer and returns the long value.
 
short ReadShort ()
 Reads the next two bytes from the buffer and returns the short value.
 
byte ReadUnsignedByte ()
 Read a unsigned byte from the buffer and advance the read offset.
 
uint ReadUnsignedInt ()
 Reads the next four bytes from the buffer and returns the unsigned int value.
 
ulong ReadUnsignedLong ()
 Reads the next eight bytes from the buffer and returns the unsigned long value.
 
ushort ReadUnsignedShort ()
 Reads the next two bytes from the buffer and returns the unsigned short value.
 
IProtonBuffer SetBoolean (long index, bool value)
 Write the given boolean value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetByte (long index, sbyte value)
 Write the given byte value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetChar (long index, char value)
 Write the given 2 byte char value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetDouble (long index, double value)
 Write the given 8 byte double value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetFloat (long index, float value)
 Write the given 4 byte float value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetInt (long index, int value)
 Write the given 4 byte int value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetLong (long index, long value)
 Write the given 8 byte long value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetShort (long index, short value)
 Write the given 2 byte short value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetUnsignedByte (long index, byte value)
 Write the given unsigned byte value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetUnsignedInt (long index, uint value)
 Write the given 4 byte unsigned int value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetUnsignedLong (long index, ulong value)
 Write the given 8 byte unsigned long value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer SetUnsignedShort (long index, ushort value)
 Write the given 2 byte unsigned short value at the given location in the buffer backing store without modifying the write offset of this buffer.
 
IProtonBuffer WriteBoolean (bool value)
 Writes the given boolean value into this buffer as a single byte and increases the write offset.
 
IProtonBuffer WriteByte (sbyte value)
 Writes the given byte value into this buffer and increases the write offset.
 
IProtonBuffer WriteDouble (double value)
 Writes the given eight byte double value into this buffer and increases the write offset.
 
IProtonBuffer WriteFloat (float value)
 Writes the given four byte float value into this buffer and increases the write offset.
 
IProtonBuffer WriteInt (int value)
 Writes the given four byte int value into this buffer and increases the write offset.
 
IProtonBuffer WriteLong (long value)
 Writes the given eight byte long value into this buffer and increases the write offset.
 
IProtonBuffer WriteShort (short value)
 Writes the given two byte short value into this buffer and increases the write offset.
 
IProtonBuffer WriteUnsignedByte (byte value)
 Writes the given unsigned byte value into this buffer and increases the write offset.
 
IProtonBuffer WriteUnsignedInt (uint value)
 Writes the given four byte unsigned int value into this buffer and increases the write offset.
 
IProtonBuffer WriteUnsignedLong (ulong value)
 Writes the given eight byte unsigned long value into this buffer and increases the write offset.
 
IProtonBuffer WriteUnsignedShort (ushort value)
 Writes the given two byte unsigned short value into this buffer and increases the write offset.
 
IProtonBuffer WriteBytes (byte[] source)
 Writes the contents of the given byte array into this buffer and advances the write offset by the number of bytes written.
 
IProtonBuffer WriteBytes (byte[] source, long offset, long length)
 Writes the contents of the given byte array into this buffer and advances the write offset by the number of bytes written.
 
IProtonBuffer WriteBytes (IProtonBuffer source)
 Transfers the bytes from the source buffer to this buffer starting at the current write offset and continues until the source buffer becomes unreadable. The write index of this buffer is increased by the number of bytes read from the source. The method also increases the read offset of the source by the same amount as was written.
 
int CompareTo (object obj)
 
int CompareTo (IProtonBuffer other)
 
override int GetHashCode ()
 
override bool Equals (object other)
 
bool Equals (IProtonBuffer other)
 
string ToString (Encoding encoding)
 Coverts the readable bytes in this buffer into a string value using the Encoding value provided. The underlying read and write offset values are not modified as a result of this operation.
 
override string ToString ()
 

Static Public Attributes

static readonly int DefaultCapacity = 64
 Default initial capacity when created without initial value.
 
static readonly int DefaultMaximumCapacity = int.MaxValue
 Default max capacity based on maximum array size limit as this buffer is backed by a byte array.
 

Properties

long Capacity [get]
 Gets the current capacity of this buffer instance which is the total amount of bytes that could be written before additional buffer capacity would be needed to allow more buffer writes. The remaining amount of writable bytes at any given time is the buffer capacity minus the write offset.
 
bool IsReadable [get]
 Returns true if the current read offset is less than the current write offset meaning there are bytes available for reading.
 
long ReadableBytes [get]
 Returns the number of bytes that can currently be read from this buffer.
 
bool IsWritable [get]
 Returns true if write offset is less than the current buffer capacity limit.
 
long WritableBytes [get]
 Returns the number of bytes that can currently be written from this buffer.
 
long ReadOffset [get, set]
 Gets or sets the current read offset in this buffer. If the read offset is set to a value larger than the current write offset an exception is thrown.
 
long WriteOffset [get, set]
 Gets or sets the current write offset in this buffer. If the write offset is set to a value less than the current read offset or larger than the current buffer capacity an exception is thrown.
 
uint ComponentCount [get]
 Returns the number of component buffers in this buffer. If this is not a composite buffer instance then the count will always be one. For a composite buffer this will be the count of the current number of component buffers contained within.
 
uint ReadableComponentCount [get]
 Returns the number of component buffers in this buffer that are readable and would be provided to calls to the for each readable buffer API. If this is not a composite buffer instance then the count will be at most one. For a composite buffer this will be the count of the current number of component buffers contained within that are readable.
 
uint WritableComponentCount [get]
 Returns the number of component buffers in this buffer that are writable and would be provided to calls to the for each writable buffer API. If this is not a composite buffer instance then the count will be at most one. For a composite buffer this will be the count of the current number of component buffers contained within that are writable.
 
bool HasReadableArray [get]
 Determines if the component is back by a byte array that has readable bytes.
 
byte[] ReadableArray [get]
 Access the readable array that backs this component if one exists otherwise throw an invalid operation exception to indicate that there is no readable byte array.
 
int ReadableArrayOffset [get]
 Access the offset into the readable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no readable byte array.
 
int ReadableArrayLength [get]
 Access the usable length of the readable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no readable byte array.
 
bool HasWritableArray [get]
 Determines if the component is back by a byte array that has writable bytes.
 
byte[] WritableArray [get]
 Access the Writable array that backs this component if one exists otherwise throw an invalid operation exception to indicate that there is no writable byte array.
 
int WritableArrayOffset [get]
 Access the offset into the writable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no writable byte array.
 
int WritableArrayLength [get]
 Access the usable length of the writable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no writable byte array.
 
- Properties inherited from Apache.Qpid.Proton.Buffer.IProtonBuffer
- Properties inherited from Apache.Qpid.Proton.Buffer.IProtonBufferAccessors
byte this[long i] [get, set]
 Indexed access to single unsigned byte values within the buffer which does not modify the read or write index value. The given index must adhere to the same constraints as the get byte and set byte level APIs in this buffer class.
 
- Properties inherited from Apache.Qpid.Proton.Buffer.IReadableComponent
- Properties inherited from Apache.Qpid.Proton.Buffer.IWritableComponent

Detailed Description

A proton buffer implementation that wraps a single heap allocated byte array and provides read and write operations on that array along with self resizing based on capacity limits.

Constructor & Destructor Documentation

◆ ProtonByteBuffer() [1/6]

Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ProtonByteBuffer ( long  initialCapacity)
inline

Create a new proton byte buffer instance with given initial capacity and limited only by the size of a byte array in max capacity.

Parameters
initialCapacityThe initial capacity of this buffer

◆ ProtonByteBuffer() [2/6]

Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ProtonByteBuffer ( long  initialCapacity,
long  maxCapacity 
)
inline

Create a new proton byte buffer instance with given initial capacity and limited to a max capacity of the given amount.

Parameters
initialCapacityThe initial capacity of this buffer

◆ ProtonByteBuffer() [3/6]

Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ProtonByteBuffer ( byte[]  backingArray)
inline

Create a new proton byte buffer instance with given backing array whose size determines that largest the buffer can ever be.

Parameters
backingArrayThe actual byte array that backs this buffer

◆ ProtonByteBuffer() [4/6]

Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ProtonByteBuffer ( byte[]  backingArray,
long  maxCapacity 
)
inline

Create a new proton byte buffer instance with given backing array as the starting backing store and uses the provided max capacity value to control how large the buffer could ever grow.

Parameters
backingArrayThe actual byte array that backs this buffer
maxCapacityThe maximum capacity this buffer can grow to

◆ ProtonByteBuffer() [5/6]

Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ProtonByteBuffer ( byte[]  backingArray,
int  arrayOffset,
long  maxCapacity 
)
inline

Create a new proton byte buffer instance with given backing array as the starting backing store and uses the provided max capacity value to control how large the buffer could ever grow.

Parameters
backingArrayThe actual byte array that backs this buffer
arrayOffsetThe offset into the backing array where the buffer starts
maxCapacityThe maximum capacity this buffer can grow to

◆ ProtonByteBuffer() [6/6]

Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ProtonByteBuffer ( byte[]  backingArray,
int  arrayOffset,
int  capacity,
long  maxCapacity 
)
inline

Create a new proton byte buffer instance with given backing array as the starting backing store and uses the provided max capacity value to control how large the buffer could ever grow.

Parameters
backingArrayThe actual byte array that backs this buffer
arrayOffsetThe offset index into the backing array where the buffer starts
capacityThe capacity limit for this view of the assigned array
maxCapacityThe maximum capacity this buffer can grow to

Member Function Documentation

◆ Compact()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Compact ( )
inline

Discards the read bytes, and moves the buffer contents to the beginning of the buffer.

Returns
this buffer instance

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ Copy() [1/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Copy ( )
inline

Returns a copy of this buffer's readable bytes. Modifying the content of the returned buffer will not affect this buffers contents. The two buffers will maintain separate offsets. The returned copy has the write offset set to the length of the copy meaning that the entire copied region is read for reading.

Returns
A new buffer with a copy of the readable bytes in this buffer

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ Copy() [2/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Copy ( long  index,
long  length 
)
inline

Returns a copy of this buffer's readable bytes. Modifying the content of the returned buffer will not affect this buffers contents. The two buffers will maintain separate offsets. The amount and start of the data to be copied is provided by the index and length arguments. The returned copy has the write offset set to the length of the copy meaning that the entire copied region is read for reading.

Parameters
indexThe read offset where the copy begins
lengthThe number of bytes to copy
Returns
A new buffer with a copy of the readable bytes in the specified region

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ CopyInto() [1/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.CopyInto ( long  srcPos,
byte[]  dest,
long  destPos,
long  length 
)
inline

Copies the given number of bytes from this buffer into the target byte buffer starting the read from the given position in this buffer and the write to at the given position in the destination buffer. The length parameter controls how many bytes are copied to the destination. This method does not modify the read or write offset values in this buffer.

Parameters
srcPosPosition in this buffer to begin the copy from
destDestination buffer where the copied bytes are written
destPosPosition in the destination where the write begins
lengthNumber of byte to copy to the destination
Returns
This buffer instance.
Exceptions
IndexOutOfRangeException
ArgumentOutOfRangeException
ArgumentNullException

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ CopyInto() [2/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.CopyInto ( long  srcPos,
IProtonBuffer  dest,
long  destPos,
long  length 
)
inline

Copies the given number of bytes from this buffer into the target byte buffer starting the read from the given position in this buffer and the write to at the given position in the destination buffer. The length parameter controls how many bytes are copied to the destination. This method does not modify the read or write offset values in this buffer nor those of the destination buffer. The destination write index is an absolute index value unrelated to the write offset of the target.

Parameters
srcPosPosition in this buffer to begin the copy from
destDestination buffer where the copied bytes are written
destPosPosition in the destination where the write begins
lengthNumber of byte to copy to the destination
Returns
This buffer instance.
Exceptions
IndexOutOfRangeException
ArgumentOutOfRangeException
ArgumentNullException

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ EnsureWritable()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.EnsureWritable ( long  amount)
inline

Requests that the buffer ensure that there is enough allocated internal capacity such that the given number of bytes can be written without requiring additional allocations and that this amount does not exceed any total capacity restrictions for this buffer.

Parameters
amountthe number of bytes that should be available fro writing
Returns
This buffer instance.
Exceptions
ArgumentOutOfRangeExceptionIf the requested amount exceeds capacity restrictions

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ Fill()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Fill ( byte  value)
inline

Fill the buffer with the given byte value. This method does not respect the read offset nor the write offset but instead fills the entire backing buffer memory with the given value.

Parameters
valueThe byte value to assign each byte in the backing store
Returns
This buffer instance.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ForEachReadableComponent()

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ForEachReadableComponent ( in int  index,
in Func< int, IReadableComponent, bool >  processor 
)
inline

Invokes the provided delegate for each readable component in this buffer and increments the provided index value for each invocation. The total number of buffers processed is returned to the caller. The delegate can stop processing at any time by returning false in which case this method will stop and return a negative value to indicate that processing stopped early and did not traverse all available components.

Parameters
indexa starting index which is increment after each call
processorThe delegate that will receive the components
Returns
The number of components processed or negative if stopped early.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ForEachWritableComponent()

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ForEachWritableComponent ( in int  index,
in Func< int, IWritableComponent, bool >  processor 
)
inline

Invokes the provided delegate for each writable component in this buffer and increments the provided index value for each invocation. The total number of buffers processed is returned to the caller. The delegate can stop processing at any time by returning false in which case this method will stop and return a negative value to indicate that processing stopped early and did not traverse all available components.

Parameters
indexa starting index which is increment after each call
processorThe delegate that will receive the components
Returns
The number of components processed or negative if stopped early.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ GetBoolean()

bool Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetBoolean ( long  index)
inline

Reads a single byte from the given index and returns a boolean value indicating if the byte was zero (false) or greater than zero (true).

Parameters
index
Returns
the boolean value of the byte at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetByte()

sbyte Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetByte ( long  index)
inline

Reads a single signed byte from the given index and returns it.

Parameters
index
Returns
the byte value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetChar()

char Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetChar ( long  index)
inline

Reads a single 2 byte char from the given index and returns it.

Parameters
index
Returns
the char value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetDouble()

double Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetDouble ( long  index)
inline

Reads a single 8 byte double from the given index and returns it.

Parameters
index
Returns
the double value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetFloat()

float Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetFloat ( long  index)
inline

Reads a single 4 byte float from the given index and returns it.

Parameters
index
Returns
the float value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetInt()

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetInt ( long  index)
inline

Reads a single 4 byte int from the given index and returns it.

Parameters
index
Returns
the int value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetLong()

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetLong ( long  index)
inline

Reads a single 8 byte long from the given index and returns it.

Parameters
index
Returns
the long value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetShort()

short Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetShort ( long  index)
inline

Reads a single 2 byte short from the given index and returns it.

Parameters
index
Returns
the short value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetUnsignedByte()

byte Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetUnsignedByte ( long  index)
inline

Reads a single unsigned byte from the given index and returns it.

Parameters
index
Returns
the byte value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetUnsignedInt()

uint Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetUnsignedInt ( long  index)
inline

Reads a single 4 byte unsigned int from the given index and returns it.

Parameters
index
Returns
the int value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetUnsignedLong()

ulong Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetUnsignedLong ( long  index)
inline

Reads a single 8 byte unsigned long from the given index and returns it.

Parameters
index
Returns
the long value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ GetUnsignedShort()

ushort Apache.Qpid.Proton.Buffer.ProtonByteBuffer.GetUnsignedShort ( long  index)
inline

Reads a single 2 byte unsigned short from the given index and returns it.

Parameters
index
Returns
the short value at the given index
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadBoolean()

bool Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadBoolean ( )
inline

Reads the next byte from the buffer and returns the boolean value.

Returns
the boolean value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadByte()

sbyte Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadByte ( )
inline

Read a signed byte from the buffer and advance the read offset.

Returns
The value read from the buffer
Exceptions
IndexOutOfRangeExceptionIf the buffer has no more readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadChar()

char Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadChar ( )
inline

Reads the two bytes from the buffer and returns the char value.

Returns
the char value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadDouble()

double Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadDouble ( )
inline

Reads the next eight bytes from the buffer and returns the double value.

Returns
the double value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadFloat()

float Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadFloat ( )
inline

Reads the next four bytes from the buffer and returns the float value.

Returns
the float value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadInt()

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadInt ( )
inline

Reads the next four bytes from the buffer and returns the int value.

Returns
the int value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadLong()

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadLong ( )
inline

Reads the next eight bytes from the buffer and returns the long value.

Returns
the long value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadShort()

short Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadShort ( )
inline

Reads the next two bytes from the buffer and returns the short value.

Returns
the short value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadSplit()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadSplit ( long  offset)
inline

Splits the buffer into two distinct buffers at the given index plus the current read offset. The returned buffer will retain the read offset and write offset of this buffer but will be truncated to match the capacity provided by the split index, which implies that they might both be set to the capacity if they were previously set beyond the split index. The returned buffer will set its read and write offsets to zero if they fell prior to the given index otherwise they will be truncated to match the new buffer capacity. Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.

Parameters
offsetThe offset to split beyond the current read offset
Returns
A new buffer that access the front portion of the buffer split

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ReadUnsignedByte()

byte Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadUnsignedByte ( )
inline

Read a unsigned byte from the buffer and advance the read offset.

Returns
The value read from the buffer
Exceptions
IndexOutOfRangeExceptionIf the buffer has no more readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadUnsignedInt()

uint Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadUnsignedInt ( )
inline

Reads the next four bytes from the buffer and returns the unsigned int value.

Returns
the unsigned int value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadUnsignedLong()

ulong Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadUnsignedLong ( )
inline

Reads the next eight bytes from the buffer and returns the unsigned long value.

Returns
the unsigned long value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ ReadUnsignedShort()

ushort Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadUnsignedShort ( )
inline

Reads the next two bytes from the buffer and returns the unsigned short value.

Returns
the unsigned short value at the given index
Exceptions
IndexOutOfRangeExceptionIf there are not enough readable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ Reclaim()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Reclaim ( )
inline

Reclaims read buffer space and returns it to the operating system or other pooling mechanisms if those are in place, then compacts the remaining buffer contents. For a non-composite buffer this operation could consist of allocating a smaller buffer to house any remaining unread bytes and freeing the larger backing buffer in some cases or it may result in a no-op depending on the buffer implementation. For the composite buffer case this operation provides an API which allows for fully read buffer constituents to be released and returned to a memory pool or back to the O/S.

Returns
this buffer instance

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ Reset()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Reset ( )
inline

Resets the read and write offset values to zero.

Returns
This buffer instance.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ SetBoolean()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetBoolean ( long  index,
bool  value 
)
inline

Write the given boolean value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetByte()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetByte ( long  index,
sbyte  value 
)
inline

Write the given byte value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetChar()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetChar ( long  index,
char  value 
)
inline

Write the given 2 byte char value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetDouble()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetDouble ( long  index,
double  value 
)
inline

Write the given 8 byte double value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetFloat()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetFloat ( long  index,
float  value 
)
inline

Write the given 4 byte float value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetInt()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetInt ( long  index,
int  value 
)
inline

Write the given 4 byte int value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetLong()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetLong ( long  index,
long  value 
)
inline

Write the given 8 byte long value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetShort()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetShort ( long  index,
short  value 
)
inline

Write the given 2 byte short value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetUnsignedByte()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetUnsignedByte ( long  index,
byte  value 
)
inline

Write the given unsigned byte value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetUnsignedInt()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetUnsignedInt ( long  index,
uint  value 
)
inline

Write the given 4 byte unsigned int value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetUnsignedLong()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetUnsignedLong ( long  index,
ulong  value 
)
inline

Write the given 8 byte unsigned long value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SetUnsignedShort()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SetUnsignedShort ( long  index,
ushort  value 
)
inline

Write the given 2 byte unsigned short value at the given location in the buffer backing store without modifying the write offset of this buffer.

Parameters
indexThe index in the buffer where the write should occur
valueThe value to be written at the specified index
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the index is negative or larger than buffer capacity

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ SkipBytes()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.SkipBytes ( long  amount)
inline

Advance the buffer read offset by the specified amount effectively skipping that number of bytes from being read.

Parameters
amountThe number of bytes to skip
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf the amount is negative or larger than readable size

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ Split() [1/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Split ( )
inline

Splits the buffer into two buffers at the write offset. The resulting buffer will comprise the read and readable portions of this buffer with the write offset and capacity set to the current write offset. This buffer will lose access to the split region and its read offset will be set to the current write offset. This buffer will also have its capacity reduced by the number of bytes in the returned buffer (i.e. the current number of read and readable bytes). Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.

Returns
A new buffer that access the front portion of the buffer split

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ Split() [2/2]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Split ( long  index)
inline

Splits the buffer into two distinct buffers at the given index. The returned buffer will retain the read offset and write offset of this buffer but will be truncated to match the capacity provided by the split index, which implies that they might both be set to the capacity if they were previously set beyond the split index. The returned buffer will set its read and write offsets to zero if they fell prior to the given index otherwise they will be truncated to match the new buffer capacity. Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.

Parameters
indexThe index in this buffer where the split occurs
Returns
A new buffer that access the front portion of the buffer split

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ToString()

string Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ToString ( Encoding  encoding)
inline

Coverts the readable bytes in this buffer into a string value using the Encoding value provided. The underlying read and write offset values are not modified as a result of this operation.

Parameters
encodingThe encoding to use to convert the readable bytes
Returns
The string value of the readable bytes as converted by the provided Encoding

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WriteBoolean()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteBoolean ( bool  value)
inline

Writes the given boolean value into this buffer as a single byte and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteByte()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteByte ( sbyte  value)
inline

Writes the given byte value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteBytes() [1/3]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteBytes ( byte[]  source)
inline

Writes the contents of the given byte array into this buffer and advances the write offset by the number of bytes written.

Parameters
sourceThe byte buffer to be written into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WriteBytes() [2/3]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteBytes ( byte[]  source,
long  offset,
long  length 
)
inline

Writes the contents of the given byte array into this buffer and advances the write offset by the number of bytes written.

Parameters
sourceThe byte buffer to be written into this buffer
offsetThe offset into the source buffer to start the write
lengthThe number of bytes from the source buffer to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WriteBytes() [3/3]

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteBytes ( IProtonBuffer  source)
inline

Transfers the bytes from the source buffer to this buffer starting at the current write offset and continues until the source buffer becomes unreadable. The write index of this buffer is increased by the number of bytes read from the source. The method also increases the read offset of the source by the same amount as was written.

Parameters
sourceThe byte buffer to be written into this buffer
lengthThe number of bytes to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WriteDouble()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteDouble ( double  value)
inline

Writes the given eight byte double value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteFloat()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteFloat ( float  value)
inline

Writes the given four byte float value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteInt()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteInt ( int  value)
inline

Writes the given four byte int value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteLong()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteLong ( long  value)
inline

Writes the given eight byte long value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteShort()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteShort ( short  value)
inline

Writes the given two byte short value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteSplit()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteSplit ( long  offset)
inline

Splits the buffer into two distinct buffers at the given index plus the current write offset. The returned buffer will retain the read offset and write offset of this buffer but will be truncated to match the capacity provided by the split index, which implies that they might both be set to the capacity if they were previously set to the split index. The returned buffer will set its read and write offsets to zero if they fell prior to the given index otherwise they will be truncated to match the new buffer capacity. Split buffers support the standard buffer operations including resizing to ensure writable regions which implies that a buffer resize on either will cause them to no longer reference the same underlying memory region. If buffer implementations implement pooling then they must ensure proper release of shared buffer regions once both buffers no longer reference them.

Parameters
offsetThe offset to split beyond the current write offset
Returns
A new buffer that access the front portion of the buffer split

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WriteUnsignedByte()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteUnsignedByte ( byte  value)
inline

Writes the given unsigned byte value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteUnsignedInt()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteUnsignedInt ( uint  value)
inline

Writes the given four byte unsigned int value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteUnsignedLong()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteUnsignedLong ( ulong  value)
inline

Writes the given eight byte unsigned long value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

◆ WriteUnsignedShort()

IProtonBuffer Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteUnsignedShort ( ushort  value)
inline

Writes the given two byte unsigned short value into this buffer and increases the write offset.

Parameters
valueThe value to write into this buffer
Returns
this buffer instance
Exceptions
IndexOutOfRangeExceptionIf there are not enough writable bytes

Implements Apache.Qpid.Proton.Buffer.IProtonBufferAccessors.

Property Documentation

◆ Capacity

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.Capacity
get

Gets the current capacity of this buffer instance which is the total amount of bytes that could be written before additional buffer capacity would be needed to allow more buffer writes. The remaining amount of writable bytes at any given time is the buffer capacity minus the write offset.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ComponentCount

uint Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ComponentCount
get

Returns the number of component buffers in this buffer. If this is not a composite buffer instance then the count will always be one. For a composite buffer this will be the count of the current number of component buffers contained within.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ HasReadableArray

bool Apache.Qpid.Proton.Buffer.ProtonByteBuffer.HasReadableArray
get

Determines if the component is back by a byte array that has readable bytes.

Implements Apache.Qpid.Proton.Buffer.IReadableComponent.

◆ HasWritableArray

bool Apache.Qpid.Proton.Buffer.ProtonByteBuffer.HasWritableArray
get

Determines if the component is back by a byte array that has writable bytes.

Implements Apache.Qpid.Proton.Buffer.IWritableComponent.

◆ IsReadable

bool Apache.Qpid.Proton.Buffer.ProtonByteBuffer.IsReadable
get

Returns true if the current read offset is less than the current write offset meaning there are bytes available for reading.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ IsWritable

bool Apache.Qpid.Proton.Buffer.ProtonByteBuffer.IsWritable
get

Returns true if write offset is less than the current buffer capacity limit.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ReadableArray

byte [] Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadableArray
get

Access the readable array that backs this component if one exists otherwise throw an invalid operation exception to indicate that there is no readable byte array.

If a byte array is returned from this method it should never be used to make modifications to the proton buffer data.

Implements Apache.Qpid.Proton.Buffer.IReadableComponent.

◆ ReadableArrayLength

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadableArrayLength
get

Access the usable length of the readable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no readable byte array.

Implements Apache.Qpid.Proton.Buffer.IReadableComponent.

◆ ReadableArrayOffset

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadableArrayOffset
get

Access the offset into the readable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no readable byte array.

Implements Apache.Qpid.Proton.Buffer.IReadableComponent.

◆ ReadableBytes

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadableBytes
get

Returns the number of bytes that can currently be read from this buffer.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ReadableComponentCount

uint Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadableComponentCount
get

Returns the number of component buffers in this buffer that are readable and would be provided to calls to the for each readable buffer API. If this is not a composite buffer instance then the count will be at most one. For a composite buffer this will be the count of the current number of component buffers contained within that are readable.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ ReadOffset

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.ReadOffset
getset

Gets or sets the current read offset in this buffer. If the read offset is set to a value larger than the current write offset an exception is thrown.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WritableArray

byte [] Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WritableArray
get

Access the Writable array that backs this component if one exists otherwise throw an invalid operation exception to indicate that there is no writable byte array.

If a byte array is returned from this method it should never be used to make modifications to the proton buffer data.

Implements Apache.Qpid.Proton.Buffer.IWritableComponent.

◆ WritableArrayLength

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WritableArrayLength
get

Access the usable length of the writable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no writable byte array.

Implements Apache.Qpid.Proton.Buffer.IWritableComponent.

◆ WritableArrayOffset

int Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WritableArrayOffset
get

Access the offset into the writable backing array if one exists otherwise throws an invalid operation exception to indicate that there is no writable byte array.

Implements Apache.Qpid.Proton.Buffer.IWritableComponent.

◆ WritableBytes

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WritableBytes
get

Returns the number of bytes that can currently be written from this buffer.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WritableComponentCount

uint Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WritableComponentCount
get

Returns the number of component buffers in this buffer that are writable and would be provided to calls to the for each writable buffer API. If this is not a composite buffer instance then the count will be at most one. For a composite buffer this will be the count of the current number of component buffers contained within that are writable.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.

◆ WriteOffset

long Apache.Qpid.Proton.Buffer.ProtonByteBuffer.WriteOffset
getset

Gets or sets the current write offset in this buffer. If the write offset is set to a value less than the current read offset or larger than the current buffer capacity an exception is thrown.

Implements Apache.Qpid.Proton.Buffer.IProtonBuffer.


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