|
Public Types |
enum | { DefaultBufferSize = 1500
} |
Public Member Functions |
| ByteBuffer (U8 *dataPtr, U32 bufferSize) |
| Create a ByteBuffer from a chunk of memory.
|
| ByteBuffer (U32 bufferSize=DefaultBufferSize) |
| Create a ByteBuffer of the specified size.
|
| ByteBuffer (const ByteBuffer &theBuffer) |
| Copy constructor!
|
| ~ByteBuffer () |
void | setBuffer (U8 *dataPtr, U32 bufferSize) |
| Set the ByteBuffer to point to a new chunk of memory.
|
void | setBuffer (U8 *dataPtr, U32 bufferSize, bool newOwnsMemory) |
| Set the ByteBuffer to point to a new chunk of memory, indicating whether it should own the chunk or not.
|
bool | resize (U32 newBufferSize) |
| Attempts to resize the buffer.
|
bool | appendBuffer (const U8 *dataBuffer, U32 bufferSize) |
| Appends the specified buffer to the end of the byte buffer.
|
bool | appendBuffer (const ByteBuffer &theBuffer) |
| Appends the specified ByteBuffer to the end of this byte buffer.
|
void | takeOwnership () |
| Copies the current buffer into a newly allocated buffer that the ByteBuffer owns.
|
bool | ownsMemory () |
| Does this ByteBuffer own its own memory?
|
U32 | getBufferSize () const |
U8 * | getBuffer () |
const U8 * | getBuffer () const |
void | clear () |
| Clear the buffer.
|
RefPtr< ByteBuffer > | encodeBase64 () const |
| Encode the buffer to base 64, returning the encoded buffer.
|
RefPtr< ByteBuffer > | decodeBase64 () const |
| Decode the buffer from base 64, returning the decoded buffer.
|
RefPtr< ByteBuffer > | computeMD5Hash (U32 len=0) const |
| Computes an MD5 hash and returns it in a ByteBuffer.
|
RefPtr< ByteBuffer > | encodeBase16 () const |
| Converts to ascii-hex, returning the encoded buffer.
|
RefPtr< ByteBuffer > | decodeBase16 () const |
| Decodes the buffer from base 16, returning the decoded buffer.
|
U32 | calculateCRC (U32 start=0, U32 end=0xFFFFFFFF, U32 crcVal=0xFFFFFFFF) const |
| Returns a 32 bit CRC for the buffer.
|
Protected Attributes |
U8 * | mDataPtr |
| Pointer to our data buffer.
|
U32 | mBufSize |
| Length of buffer.
|
bool | mOwnsMemory |
| Do we own the memory we are using? (If so, we should free it.).
|
Friends |
struct | MethodArgList |