Correct me if I am wrong, but unless you serialize the data better than that, 
it will not be portable between different hardware platforms (i.e. 32bit vs 
64bit, x86 vs PPC vs Sun, etc...).  This gets into more than just endianization 
(which is also handled by the buffer class).

Wes


-----Original Message-----
From: Alan Conway [mailto:acon...@redhat.com]
Sent: Fri 5/22/2009 7:41 AM
To: users@qpid.apache.org
Subject: Re: Binary Data Transfer
 
Wes Parish wrote:
> Is the Qpid C++ Client API capable of transferring binary data?  It seems 
> like the only data type in qpid/client/Message.h is the std::string (data 
> field of TransferContent.h).  
> 
> I am interested in transferring segments of binary data, and not ascii 
> strings.  Is this possible with the current Qpid C++ API implementation?  I 
> have not researched the AMQP protocol much yet, but had assumed this would be 
> possible with the wire protocol.  If it is not currently implemented, but it 
> is possible, would it be as simple as overridding the TransferContent and 
> Message classes and working backwards from there?
> 

std::string in C++ is simply a string of bytes, which can include 0 bytes. So 
you can transfer binary data in a std::string like this:
char* p = start_of_data;
size_t len = length_of_data;
std::string s(p, len); // contains a copy of data.



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscr...@qpid.apache.org



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscr...@qpid.apache.org

Reply via email to