KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CORBA > AnySeqHelper


1 /*
2  * @(#)AnySeqHelper.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package org.omg.CORBA;
8
9
10 /**
11 * The Helper for <tt>AnySeq</tt>. For more information on
12 * Helper files, see <a HREF="doc-files/generatedfiles.html#helper">
13 * "Generated Files: Helper Files"</a>.<P>
14 * org/omg/CORBA/AnySeqHelper.java
15 * Generated by the IDL-to-Java compiler (portable), version "3.0"
16 * from streams.idl
17 * 13 May 1999 22:41:36 o'clock GMT+00:00
18 *
19 * The class definition has been modified to conform to the following
20 * OMG specifications :
21 * <ul>
22 * <li> ORB core as defined by CORBA 2.3.1
23 * (<a HREF="http://cgi.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
24 * </li>
25 *
26 * <li> IDL/Java Language Mapping as defined in
27 * <a HREF="http://cgi.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
28 * </li>
29 * </ul>
30 */

31
32 public abstract class AnySeqHelper
33 {
34     private static String JavaDoc _id = "IDL:omg.org/CORBA/AnySeq:1.0";
35
36     public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.CORBA.Any JavaDoc[] that)
37     {
38     org.omg.CORBA.portable.OutputStream JavaDoc 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 JavaDoc[] extract (org.omg.CORBA.Any JavaDoc a)
45     {
46     return read (a.create_input_stream ());
47     }
48
49     private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
50     synchronized public static org.omg.CORBA.TypeCode JavaDoc 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 JavaDoc id ()
62     {
63     return _id;
64     }
65
66     public static org.omg.CORBA.Any JavaDoc[] read (org.omg.CORBA.portable.InputStream JavaDoc istream)
67     {
68     org.omg.CORBA.Any JavaDoc value[] = null;
69     int _len0 = istream.read_long ();
70     value = new org.omg.CORBA.Any JavaDoc[_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 JavaDoc ostream, org.omg.CORBA.Any JavaDoc[] 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