1. /*
  2. * @(#)EncapsulationFactoryBase.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.InputStream ;
  9. import com.sun.corba.se.impl.ior.EncapsulationUtility ;
  10. public abstract class EncapsulationFactoryBase implements IdentifiableFactory {
  11. private int id ;
  12. public int getId()
  13. {
  14. return id ;
  15. }
  16. public EncapsulationFactoryBase( int id )
  17. {
  18. this.id = id ;
  19. }
  20. public final Identifiable create( InputStream in )
  21. {
  22. InputStream is = EncapsulationUtility.getEncapsulationStream( in ) ;
  23. return readContents( is ) ;
  24. }
  25. protected abstract Identifiable readContents( InputStream is ) ;
  26. }