1 7 package org.omg.CORBA; 8 9 10 31 32 public abstract class AnySeqHelper 33 { 34 private static String _id = "IDL:omg.org/CORBA/AnySeq:1.0"; 35 36 public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Any [] that) 37 { 38 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 39 a.type (type ()); 40 write (out, that); 41 a.read_value (out.create_input_stream (), type ()); 42 } 43 44 public static org.omg.CORBA.Any [] extract (org.omg.CORBA.Any a) 45 { 46 return read (a.create_input_stream ()); 47 } 48 49 private static org.omg.CORBA.TypeCode __typeCode = null; 50 synchronized public static org.omg.CORBA.TypeCode type () 51 { 52 if (__typeCode == null) 53 { 54 __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); 55 __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); 56 __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.AnySeqHelper.id (), "AnySeq", __typeCode); 57 } 58 return __typeCode; 59 } 60 61 public static String id () 62 { 63 return _id; 64 } 65 66 public static org.omg.CORBA.Any [] read (org.omg.CORBA.portable.InputStream istream) 67 { 68 org.omg.CORBA.Any value[] = null; 69 int _len0 = istream.read_long (); 70 value = new org.omg.CORBA.Any [_len0]; 71 for (int _o1 = 0;_o1 < value.length; ++_o1) 72 value[_o1] = istream.read_any (); 73 return value; 74 } 75 76 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Any [] value) 77 { 78 ostream.write_long (value.length); 79 for (int _i0 = 0;_i0 < value.length; ++_i0) 80 ostream.write_any (value[_i0]); 81 } 82 83 } 84 | Popular Tags |