Applied sizeof operator on fixed sized array to calculate size.
[platform/framework/native/appfw.git] / inc / FBaseUtilStringUtil.h
index f6ff573..128cdd3 100644 (file)
@@ -293,16 +293,15 @@ public:
         *
         *      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
         */
@@ -330,10 +329,9 @@ public:
         *
         *      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