001 package org.omg.SECIOP;
002
003
004 /**
005 * Generated from IDL struct "GenericMechanismInfo".
006 *
007 * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007
008 * @version generated at Nov 6, 2011 12:20:29 AM
009 */
010
011 public final class GenericMechanismInfoHelper
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.SECIOP.GenericMechanismInfoHelper.id(),"GenericMechanismInfo",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("security_mechanism_type", 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("mech_specific_data", 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.SECIOP.GenericMechanismInfo s)
024 {
025 any.type(type());
026 write( any.create_output_stream(),s);
027 }
028
029 public static org.omg.SECIOP.GenericMechanismInfo 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/SECIOP/GenericMechanismInfo:1.0";
037 }
038 public static org.omg.SECIOP.GenericMechanismInfo read (final org.omg.CORBA.portable.InputStream in)
039 {
040 org.omg.SECIOP.GenericMechanismInfo result = new org.omg.SECIOP.GenericMechanismInfo();
041 int _lresult_security_mechanism_type0 = in.read_long();
042 try
043 {
044 int x = in.available();
045 if ( x > 0 && _lresult_security_mechanism_type0 > x )
046 {
047 throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_security_mechanism_type0);
048 }
049 }
050 catch (java.io.IOException e)
051 {
052 }
053 result.security_mechanism_type = new byte[_lresult_security_mechanism_type0];
054 in.read_octet_array(result.security_mechanism_type,0,_lresult_security_mechanism_type0);
055 int _lresult_mech_specific_data1 = in.read_long();
056 try
057 {
058 int x = in.available();
059 if ( x > 0 && _lresult_mech_specific_data1 > x )
060 {
061 throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_mech_specific_data1);
062 }
063 }
064 catch (java.io.IOException e)
065 {
066 }
067 result.mech_specific_data = new byte[_lresult_mech_specific_data1];
068 in.read_octet_array(result.mech_specific_data,0,_lresult_mech_specific_data1);
069 int _lresult_components2 = in.read_long();
070 try
071 {
072 int x = in.available();
073 if ( x > 0 && _lresult_components2 > x )
074 {
075 throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _lresult_components2);
076 }
077 }
078 catch (java.io.IOException e)
079 {
080 }
081 result.components = new org.omg.IOP.TaggedComponent[_lresult_components2];
082 for (int i=0;i<result.components.length;i++)
083 {
084 result.components[i]=org.omg.IOP.TaggedComponentHelper.read(in);
085 }
086
087 return result;
088 }
089 public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.SECIOP.GenericMechanismInfo s)
090 {
091
092 out.write_long(s.security_mechanism_type.length);
093 out.write_octet_array(s.security_mechanism_type,0,s.security_mechanism_type.length);
094
095 out.write_long(s.mech_specific_data.length);
096 out.write_octet_array(s.mech_specific_data,0,s.mech_specific_data.length);
097
098 out.write_long(s.components.length);
099 for (int i=0; i<s.components.length;i++)
100 {
101 org.omg.IOP.TaggedComponentHelper.write(out,s.components[i]);
102 }
103
104 }
105 }