* @return an Any that holds a copy of this union
*/
public org.omg.CORBA.Any to_any()
{
checkDestroyed ();
final CDROutputStream out = new CDROutputStream(orb);
try
{
out.write_value( discriminator.type(),
discriminator.create_input_stream() );
out.write_value( member.type(),
member.to_any().create_input_stream());
org.omg.CORBA.Any out_any = orb.create_any();
out_any.type( type() );
final CDRInputStream in = new CDRInputStream( orb, out.getBufferCopy());
try
{
out_any.read_value( in, type());
return out_any;
}
finally
{
in.close();
}
}
finally
{
out.close();
}
}