[omniORB] Java to C++ hell

Duncan Grisby duncan at grisby.org
Sat Mar 1 16:00:25 GMT 2008


On Thursday 28 February, "Janusz Dalecki" wrote:

> For the reasons that is very hard to explain in short description I need
> to un-marshal and marshal "Any" object coming from the stream data
> Socket(from Java app) as a basically array of bytes. Is there any
> utility in OMNIOrb that would help me to translate the stream of bytes
> sent from Java world to C++ any object? 
> 
> Any help very much appreciated.!!!

The way that's endorsed by the CORBA standard is with the Codec
interfaces, but omniORB doesn't support that.

Instead, you can use the omniORB cdrStream classes. Look in
include/omniORB4/cdrStream.h at cdrMemoryStream and
cdrEncapsulationStream. You probably want to use cdrEncapsulationStream
to handle a CDR encapsulation that includes byte order information.

Hopefully it's obvious how to use them. Search through the code for
places they're used to see some examples.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list