// The CDROutputStream only does big endian currently.
throw new Error("We can only marshal big endian stylee profiles !!");
}
// Start a CDR encapsulation for the profile_data
CDROutputStream profileDataStream = new CDROutputStream();
profileDataStream.beginEncapsulatedArray();
// Write the opaque AddressProfile bytes for this profile...
writeAddressProfile(profileDataStream);
// ... then the object key
profileDataStream.write_long(objectKey.length);
profileDataStream.write_octet_array(objectKey,0,objectKey.length);
switch( version.minor )
{
case 0 :
// For GIOP 1.0 there were no tagged components
break;
default :
// Assume minor != 0 means 1.1 onwards and encode the TaggedComponents
if (components == null)
{
components = new TaggedComponentSeqHolder (new TaggedComponent[0]);
}
// Write the length of the TaggedProfile sequence.
profileDataStream.write_long(this.components.size() + components.value.length);
// Write the TaggedProfiles (ours first, then the ORB's)
for (int i = 0; i < this.components.asArray().length; i++)
{
TaggedComponentHelper.write(profileDataStream, this.components.asArray()[i]);
}
for (int i = 0; i < components.value.length; i++)
{
TaggedComponentHelper.write(profileDataStream, components.value[i]);
}
}
// Populate the TaggedProfile for return.
tagged_profile.value = new TaggedProfile
(
this.tag(),
profileDataStream.getBufferCopy()
);
}