KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > bugs > bug532 > ByteSequenceHelper


1 package org.jacorb.test.bugs.bug532;
2
3
4
5
6
7 /**
8
9 * org/jacorb/test/bugs/bug532/ByteSequenceHelper.java .
10
11 * Generated by the IDL-to-Java compiler (portable), version "3.1"
12
13 * from bug532.idl
14
15 * Friday, February 25, 2005 12:31:43 AM EET
16
17 */

18
19
20
21
22
23 // an octet sequence other than OctetSequence
24

25 abstract public class ByteSequenceHelper
26
27 {
28
29   private static String JavaDoc _id = "IDL:org/jacorb/test/bugs/bug532/ByteSequence:1.0";
30
31
32
33   public static void insert (org.omg.CORBA.Any JavaDoc a, byte[] that)
34
35   {
36
37     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
38
39     a.type (type ());
40
41     write (out, that);
42
43     a.read_value (out.create_input_stream (), type ());
44
45   }
46
47
48
49   public static byte[] extract (org.omg.CORBA.Any JavaDoc a)
50
51   {
52
53     return read (a.create_input_stream ());
54
55   }
56
57
58
59   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
60
61   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
62
63   {
64
65     if (__typeCode == null)
66
67     {
68
69       __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
70
71       __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
72
73       __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.jacorb.test.bugs.bug532.ByteSequenceHelper.id (), "ByteSequence", __typeCode);
74
75     }
76
77     return __typeCode;
78
79   }
80
81
82
83   public static String JavaDoc id ()
84
85   {
86
87     return _id;
88
89   }
90
91
92
93   public static byte[] read (org.omg.CORBA.portable.InputStream JavaDoc istream)
94
95   {
96
97     byte value[] = null;
98
99     int _len0 = istream.read_long ();
100
101     value = new byte[_len0];
102
103     istream.read_octet_array (value, 0, _len0);
104
105     return value;
106
107   }
108
109
110
111   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, byte[] value)
112
113   {
114
115     ostream.write_long (value.length);
116
117     ostream.write_octet_array (value, 0, value.length);
118
119   }
120
121
122
123 }
124
125
Popular Tags