*
* String encodedStr;
* ByteBuffer buffer;
- * buffer.Construct(size + 1);
+ * buffer.Construct(size);
*
- * buffer.SetArray((byte*)pChar, 0, size);
- * buffer.SetByte('\0');
+ * buffer.SetArray(reinterpret_cast< const byte* >(pChar), 0, size);
* buffer.Flip();
*
* StringUtil::EncodeToBase64String(buffer, encodedStr);
*
* // Decodes a String consisting of base 64 digits to a ByteBuffer
- * ByteBuffer* pDecodedBuffer = StringUtil::DecodeBase64StringN(encodedStr);
+ * std::unique_ptr< ByteBuffer > pDecodedBuffer(StringUtil::DecodeBase64StringN(encodedStr));
*
* @endcode
*/
*
* String encodedStr;
* ByteBuffer buffer;
- * buffer.Construct(size + 1);
+ * buffer.Construct(size);
*
- * buffer.SetArray((byte*)pChar, 0, size);
- * buffer.SetByte('\0');
+ * buffer.SetArray(reinterpret_cast< const byte* >(pChar), 0, size);
* buffer.Flip();
*
* // Encodes a ByteBuffer into a String consisting of base 64 characters