001 package org.omg.IIOP; 002 003 004 /** 005 * Generated from IDL struct "ProfileBody_1_1". 006 * 007 * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007 008 * @version generated at Jun 18, 2012 10:36:58 AM 009 */ 010 011 public final class ProfileBody_1_1Helper 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.IIOP.ProfileBody_1_1Helper.id(),"ProfileBody_1_1",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("iiop_version", org.omg.IIOP.VersionHelper.type(), null),new org.omg.CORBA.StructMember("host", org.omg.CORBA.ORB.init().create_string_tc(0), null),new org.omg.CORBA.StructMember("port", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(4)), null),new org.omg.CORBA.StructMember("object_key", org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(10))), null),new org.omg.CORBA.StructMember("components", org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.IOP.TaggedComponentHelper.type()), null)}); 019 } 020 return _type; 021 } 022 023 public static void insert (final org.omg.CORBA.Any any, final org.omg.IIOP.ProfileBody_1_1 s) 024 { 025 any.type(type()); 026 write( any.create_output_stream(),s); 027 } 028 029 public static org.omg.IIOP.ProfileBody_1_1 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/IIOP/ProfileBody_1_1:1.0"; 037 } 038 public static org.omg.IIOP.ProfileBody_1_1 read (final org.omg.CORBA.portable.InputStream in) 039 { 040 org.omg.IIOP.ProfileBody_1_1 result = new org.omg.IIOP.ProfileBody_1_1(); 041 result.iiop_version=org.omg.IIOP.VersionHelper.read(in); 042 result.host=in.read_string(); 043 result.port=in.read_ushort(); 044 int _lresult_object_key1 = in.read_long(); 045 try 046 { 047 int x = in.available(); 048 if ( x > 0 && _lresult_object_key1 > x ) 049 { 050 throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_object_key1); 051 } 052 } 053 catch (java.io.IOException e) 054 { 055 } 056 result.object_key = new byte[_lresult_object_key1]; 057 in.read_octet_array(result.object_key,0,_lresult_object_key1); 058 int _lresult_components2 = in.read_long(); 059 try 060 { 061 int x = in.available(); 062 if ( x > 0 && _lresult_components2 > x ) 063 { 064 throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_components2); 065 } 066 } 067 catch (java.io.IOException e) 068 { 069 } 070 result.components = new org.omg.IOP.TaggedComponent[_lresult_components2]; 071 for (int i=0;i<result.components.length;i++) 072 { 073 result.components[i]=org.omg.IOP.TaggedComponentHelper.read(in); 074 } 075 076 return result; 077 } 078 public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IIOP.ProfileBody_1_1 s) 079 { 080 org.omg.IIOP.VersionHelper.write(out,s.iiop_version); 081 out.write_string(s.host); 082 out.write_ushort(s.port); 083 084 out.write_long(s.object_key.length); 085 out.write_octet_array(s.object_key,0,s.object_key.length); 086 087 out.write_long(s.components.length); 088 for (int i=0; i<s.components.length;i++) 089 { 090 org.omg.IOP.TaggedComponentHelper.write(out,s.components[i]); 091 } 092 093 } 094 }