#include <BByteArray.h>
Public Member Functions | |
| void | Add (const BByteArray &arr) |
| Add data from another BByteArray object to the end of this BByteArray. | |
| void | Add (const void *pBytes, size_t len) |
| Adds bytes from a buffer to the end of this BByteArray. | |
| void | Add (const Byte &val) |
| Adds a Byte to the end of this BByteArray. | |
| BByteArray (const BByteArray &arr) | |
| Copy constructor. | |
| BByteArray (const void *pBytes, size_t len) | |
| Constructor. | |
| BByteArray (size_t num) | |
| Constructor. | |
| BByteArray () | |
| Default constructor. | |
| void | Clear (void) |
| Removes all data from this BByteArray. | |
| void | CopyToBuffer (Byte *pBuf, size_t startPos, size_t len) const |
| Copy data from this BByteArray to a buffer. | |
| BByteArray | CopyToByteArray (size_t startPos, size_t len) const |
| Copy bytes from this BByteArray to a new BByteAray object. | |
| const Byte & | GetAt (size_t index) const |
| Gets a Byte from this BByteArray. | |
| Byte & | GetAt (size_t index) |
| Gets a Byte from this BByteArray. | |
| size_t | GetCount (void) const |
| Get the capacity of the byte array. | |
| const Byte * | GetDataPtr (size_t index=0) const |
| Provides read-only access to the internal data buffer. | |
| operator const Byte * (void) const | |
| Casts a BByteArray object to a const Byte pointer. | |
| BByteArray & | operator+= (const BByteArray &arr) |
| Appends the contents of a BByteArray object to the end of this BByteArray. | |
| BByteArray & | operator+= (const Byte &val) |
| Appends a Byte to the end of this BByteArray. | |
| Byte & | operator[] (size_t index) |
| Gets a Byte from this BByteArray. | |
| void | Reserve (size_t num) |
| Reserves space in the collection for the specified number of objects. | |
| virtual | ~BByteArray () |
| Destructor. | |
Protected Attributes | |
| Byte * | m_bytes |
| The contents of this BByteArray. | |
| size_t | m_capacity |
| The maximum capacity of this BByteArray. | |
| size_t | m_nextPos |
| The index at which new data can be added. | |
| BByteArray | ( | ) |
Default constructor.
This constructor will create an empty collection.
| BByteArray | ( | size_t | num | ) |
Constructor.
This constructor will create an empty collection, and it will reserve space for the specified number of Bytes.
| num | The initial number of Bytes for which space shall be reserved. |
| BByteArray | ( | const void * | pBytes, | |
| size_t | len | |||
| ) |
Constructor.
This will initialize the BByteArray using the supplied data.
| pBytes | Pointer to the buffer containing the data. | |
| len | The length of the buffer. |
| BByteArray | ( | const BByteArray & | arr | ) |
| virtual ~BByteArray | ( | ) | [virtual] |
Destructor.
| void Add | ( | const BByteArray & | arr | ) |
Add data from another BByteArray object to the end of this BByteArray.
| arr | The BByteArray to append to this BByteArray. |
| BIndexOutOfBoundsException | This exception will be thrown if there has not been a sufficient amount of space reserved in this BByteArray to contain the new data. |
| void Add | ( | const void * | pBytes, | |
| size_t | len | |||
| ) |
Adds bytes from a buffer to the end of this BByteArray.
| pBytes | Pointer to the buffer containing the data. | |
| len | The length of the buffer. |
| BIndexOutOfBoundsException | This exception will be thrown if there has not been a sufficient amount of space reserved in this BByteArray to contain the new data. |
| void Add | ( | const Byte & | val | ) |
Adds a Byte to the end of this BByteArray.
| val | The Byte to add to this BByteArray. |
| BIndexOutOfBoundsException | This exception will be thrown if there has not been a sufficient amount of space reserved in this BByteArray to contain the new Byte. |
| void Clear | ( | void | ) |
Removes all data from this BByteArray.
| void CopyToBuffer | ( | Byte * | pBuf, | |
| size_t | startPos, | |||
| size_t | len | |||
| ) | const |
Copy data from this BByteArray to a buffer.
| pBuf | The buffer to which data will be copied. This buffer must be allocated with at least len bytes. | |
| startPos | The position in the BByteArray to start copying. | |
| len | The number of bytes to copy. |
| BIndexOutOfBoundsException | This exception will be thrown if the startPos is not within the bounds of this BByteArray. |
| BByteArray CopyToByteArray | ( | size_t | startPos, | |
| size_t | len | |||
| ) | const |
Copy bytes from this BByteArray to a new BByteAray object.
| startPos | The position in the BByteArray to start copying. | |
| len | The number of bytes to copy. |
| BIndexOutOfBoundsException | This exception will be thrown if the startPos is not within the bounds of this BByteArray. |
| const Byte& GetAt | ( | size_t | index | ) | const |
Gets a Byte from this BByteArray.
| index | The zero-based index of the desired Byte. |
| BIndexOutOfBoundsException | This exception will be thrown if there is not a Byte at the specified index in this BByteArray. |
| Byte& GetAt | ( | size_t | index | ) |
Gets a Byte from this BByteArray.
| index | The zero-based index of the desired Byte. |
| BIndexOutOfBoundsException | This exception will be thrown if there is not a Byte at the specified index in this BByteArray. |
| size_t GetCount | ( | void | ) | const [inline] |
Get the capacity of the byte array.
This will return the amount of space that has been reserved in this BByteArray, not the number of bytes that have been added to the BByteArray.
| const Byte* GetDataPtr | ( | size_t | index = 0 |
) | const |
Provides read-only access to the internal data buffer.
| index | The zero-based index of the desired Byte. |
| BIndexOutOfBoundsException | This exception will be thrown if the specified index is outside the bounds of this BByteArray. |
| operator const Byte * | ( | void | ) | const [inline] |
| BByteArray& operator+= | ( | const BByteArray & | arr | ) |
Appends the contents of a BByteArray object to the end of this BByteArray.
| arr | The BByteArray object to append to this BByteArray. |
| BIndexOutOfBoundsException | This exception will be thrown if there has not been a sufficient amount of space reserved in this BByteArray to contain the new data. |
| BByteArray& operator+= | ( | const Byte & | val | ) |
Appends a Byte to the end of this BByteArray.
| val | The Byte to be appended to this BByteArray. |
| BIndexOutOfBoundsException | This exception will be thrown if there has not been a sufficient amount of space reserved in this BByteArray to contain the new Byte. |
| Byte& operator[] | ( | size_t | index | ) |
Gets a Byte from this BByteArray.
| index | The zero-based index of the desired Byte in this BByteArray. |
| BIndexOutOfBoundsException | This exception will be thrown if there is not a Byte at the specified index in this BByteArray. |
| void Reserve | ( | size_t | num | ) |
Reserves space in the collection for the specified number of objects.
| num | The number of objects to reserve space for. |
The contents of this BByteArray.
size_t m_capacity [protected] |
The maximum capacity of this BByteArray.
size_t m_nextPos [protected] |
The index at which new data can be added.