[omniORB] CORBA::Any serialization

J. Cameijo Cerdeira jverissi@mail.telepac.pt
Thu, 06 May 1999 00:20:25 +0100


Hi,

I'm writing a server which needs to serialize an Any data type in order 
to write/read it to/from a blob field on a database. I cannot find a
suitable way to do this using the CORBA C++ mapping (although i think
the java one allows an any to be used with an output or input stream)

An octet string since cannot be used since that Any value must be
exchanged with the clients who expect structured data. It's clear that
if serialization is shifted to the client side, it poses the same
problem.

I believe there's no portable way to do this. Anyway, using omniORB i
devised the following procedure for serialization (deserialization would
be done the other way around):

-write the any to a MemBufferedStream
-issue get_char_array to read a character array with the serialized
data.

The problem is I cannot tell which is the size of the data stored in 
MemBufferedStream since itssize() method is private. Why is this ?
What's the possible workarounds ? Am I missing something ?

MTIA

J. Cameijo Cerdeira