org.omg.IOP.ServiceContext service_context,
boolean replace )
{
int id = 0 ;
// Convert IOP.service_context to core.ServiceContext:
EncapsOutputStream outputStream = new EncapsOutputStream(
myORB );
InputStream inputStream = null;
UnknownServiceContext coreServiceContext = null;
ServiceContextHelper.write( outputStream, service_context );
inputStream = outputStream.create_input_stream();
// Constructor expects id to already have been read from stream.
coreServiceContext = new UnknownServiceContext(
inputStream.read_long(),
(org.omg.CORBA_2_3.portable.InputStream)inputStream );