1. /*
  2. * @(#)TaggedComponentBase.java 1.9 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.InputStream ;
  9. import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
  10. import com.sun.corba.se.spi.orb.ORB ;
  11. /** Base class to use for implementing TaggedComponents. It implements
  12. * the getIOPComponent method using the TaggedComponent.write() method.
  13. * @author Ken Cavanaugh
  14. */
  15. public abstract class TaggedComponentBase extends IdentifiableBase
  16. implements TaggedComponent
  17. {
  18. public org.omg.IOP.TaggedComponent getIOPComponent(
  19. org.omg.CORBA.ORB orb )
  20. {
  21. EncapsOutputStream os = new EncapsOutputStream( (ORB)orb ) ;
  22. write( os ) ;
  23. InputStream is = (InputStream)(os.create_input_stream() ) ;
  24. return org.omg.IOP.TaggedComponentHelper.read( is ) ;
  25. }
  26. }