001 package org.omg.IOP; 002 003 004 /** 005 * Generated from IDL struct "IOR". 006 * 007 * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007 008 * @version generated at Sep 22, 2012 10:57:16 AM 009 */ 010 011 public final class IORHelper 012 { 013 private static org.omg.CORBA.TypeCode _type = null; 014 public static org.omg.CORBA.TypeCode type () 015 { 016 if (_type == null) 017 { 018 _type = org.omg.CORBA.ORB.init().create_struct_tc(org.omg.IOP.IORHelper.id(),"IOR",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("type_id", org.omg.CORBA.ORB.init().create_string_tc(0), null),new org.omg.CORBA.StructMember("profiles", org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.IOP.TaggedProfileHelper.type()), null)}); 019 } 020 return _type; 021 } 022 023 public static void insert (final org.omg.CORBA.Any any, final org.omg.IOP.IOR s) 024 { 025 any.type(type()); 026 write( any.create_output_stream(),s); 027 } 028 029 public static org.omg.IOP.IOR extract (final org.omg.CORBA.Any any) 030 { 031 return read(any.create_input_stream()); 032 } 033 034 public static String id() 035 { 036 return "IDL:omg.org/IOP/IOR:1.0"; 037 } 038 public static org.omg.IOP.IOR read (final org.omg.CORBA.portable.InputStream in) 039 { 040 org.omg.IOP.IOR result = new org.omg.IOP.IOR(); 041 result.type_id=in.read_string(); 042 int _lresult_profiles1 = in.read_long(); 043 try 044 { 045 int x = in.available(); 046 if ( x > 0 && _lresult_profiles1 > x ) 047 { 048 throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_profiles1); 049 } 050 } 051 catch (java.io.IOException e) 052 { 053 } 054 result.profiles = new org.omg.IOP.TaggedProfile[_lresult_profiles1]; 055 for (int i=0;i<result.profiles.length;i++) 056 { 057 result.profiles[i]=org.omg.IOP.TaggedProfileHelper.read(in); 058 } 059 060 return result; 061 } 062 public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IOP.IOR s) 063 { 064 out.write_string(s.type_id); 065 066 out.write_long(s.profiles.length); 067 for (int i=0; i<s.profiles.length;i++) 068 { 069 org.omg.IOP.TaggedProfileHelper.write(out,s.profiles[i]); 070 } 071 072 } 073 }