1. /*
  2. * @(#)IdentifiableBase.java 1.7 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.spi.ior;
  8. import org.omg.CORBA_2_3.portable.OutputStream ;
  9. import com.sun.corba.se.spi.ior.Writeable ;
  10. import com.sun.corba.se.spi.ior.WriteContents ;
  11. import com.sun.corba.se.spi.orb.ORB ;
  12. import com.sun.corba.se.impl.ior.EncapsulationUtility ;
  13. /** Provide support for properly reading and writing Identifiable objects
  14. * that are also encapsulations (tagged profiles and components).
  15. */
  16. public abstract class IdentifiableBase implements Identifiable,
  17. WriteContents
  18. {
  19. /** Write the data for this object as a CDR encapsulation.
  20. * This is used for writing tagged components and profiles.
  21. * These data types must be written out as encapsulations,
  22. * which means that we need to first write the data out to
  23. * an encapsulation stream, then extract the data and write
  24. * it to os as an array of octets.
  25. */
  26. final public void write( OutputStream os )
  27. {
  28. EncapsulationUtility.writeEncapsulation( (WriteContents)this, os ) ;
  29. }
  30. }