You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mark <no...@spamgourmet.com> on 2013/11/14 15:16:55 UTC

ActiveMQ CPP

Does the method cms::BytesMessage::getBodyBytes() return a buffer that
requires free-ing by the caller?



Re: ActiveMQ CPP

Posted by Timothy Bish <ta...@gmail.com>.
On 11/14/2013 10:13 AM, Mark wrote:
> On Thu, 14 Nov 2013 09:57:40 -0500, Timothy Bish
> <ta...@gmail.com> wrote:
>
>> On 11/14/2013 09:16 AM, Mark wrote:
>>> Does the method cms::BytesMessage::getBodyBytes() return a buffer that
>>> requires free-ing by the caller?
>>>
>>>
>>>
>>  From the API Docs
>>
>>          /**
>>           * Gets the bytes that are contained in this message and
>> returns them in a newly
>>           * allocated array that becomes the property of the caller.
>> This is a copy of the
>>           * data contained in this message, changing the value contained
>> in this array has
>>           * no effect on the data contained in this message.
>>           *
>>           * @return pointer to a byte buffer that the call owns upon
>> completion of this
>>           *         method.
>>           *
>>           * @throws CMSException - If an internal error occurs.
>>           * @throws MessageNotReadableException - If the message is in
>> Write Only Mode.
>>           */
> I have seen different versions of the docs which say different things.
> Hence the question.  Am I correct in assuming that the answer to my
> question is "yes" then?
>
>
>
>
Yes, current docs match current behavior, assuming you are using a 
recent release.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: ActiveMQ CPP

Posted by Mark <no...@spamgourmet.com>.
On Thu, 14 Nov 2013 09:57:40 -0500, Timothy Bish
<ta...@gmail.com> wrote:

>On 11/14/2013 09:16 AM, Mark wrote:
>> Does the method cms::BytesMessage::getBodyBytes() return a buffer that
>> requires free-ing by the caller?
>>
>>
>>
> From the API Docs
>
>         /**
>          * Gets the bytes that are contained in this message and 
>returns them in a newly
>          * allocated array that becomes the property of the caller. 
>This is a copy of the
>          * data contained in this message, changing the value contained 
>in this array has
>          * no effect on the data contained in this message.
>          *
>          * @return pointer to a byte buffer that the call owns upon 
>completion of this
>          *         method.
>          *
>          * @throws CMSException - If an internal error occurs.
>          * @throws MessageNotReadableException - If the message is in 
>Write Only Mode.
>          */

I have seen different versions of the docs which say different things.
Hence the question.  Am I correct in assuming that the answer to my
question is "yes" then?




Re: ActiveMQ CPP

Posted by Timothy Bish <ta...@gmail.com>.
On 11/14/2013 09:16 AM, Mark wrote:
> Does the method cms::BytesMessage::getBodyBytes() return a buffer that
> requires free-ing by the caller?
>
>
>
 From the API Docs

         /**
          * Gets the bytes that are contained in this message and 
returns them in a newly
          * allocated array that becomes the property of the caller. 
This is a copy of the
          * data contained in this message, changing the value contained 
in this array has
          * no effect on the data contained in this message.
          *
          * @return pointer to a byte buffer that the call owns upon 
completion of this
          *         method.
          *
          * @throws CMSException - If an internal error occurs.
          * @throws MessageNotReadableException - If the message is in 
Write Only Mode.
          */

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/