Import GNU Classpath (20121202).
[official-gcc.git] / libjava / classpath / org / omg / CORBA / portable / InputStream.java
blob4ac63b66dcd23ae8b35d3b50019ee05293ea09be
1 /* InputStream.java --
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package org.omg.CORBA.portable;
41 import java.math.BigDecimal;
43 import org.omg.CORBA.Any;
44 import org.omg.CORBA.Context;
45 import org.omg.CORBA.NO_IMPLEMENT;
46 import org.omg.CORBA.ORB;
47 import org.omg.CORBA.Object;
48 import org.omg.CORBA.Principal;
49 import org.omg.CORBA.TypeCode;
51 /**
52 * This class is used to read CORBA IDL data types.
54 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
56 public abstract class InputStream
57 extends java.io.InputStream
59 /**
60 * Return the Object Request Broker that has created this stream.
61 * @return the ORB. This must be overridden, as the default
62 * method always returns null.
64 public ORB orb()
66 return null;
69 /**
70 * This should read the CORBA context, but following the 1.4 API
71 * specification, it must not be implemented.
73 * @throws NO_IMPLEMENT, always.
75 public Context read_Context()
77 throw new NO_IMPLEMENT();
80 /**
81 * Read a CORBA (not java) object
82 * @return an object.
84 public abstract org.omg.CORBA.Object read_Object();
86 /**
87 * Read a CORBA <code>char</code>.
88 * @return a value, corresponding the value of the CORBA <code>char</code>.
90 public abstract char read_char();
92 /**
93 * Read a CORBA <code>double</code>.
94 * @return a value, corresponding the value of the CORBA <code>double</code>.
96 public abstract double read_double();
98 /**
99 * Read a CORBA <code>float</code>.
100 * @return a value, corresponding the value of the CORBA <code>float</code>.
102 public abstract float read_float();
105 * Read a and array of CORBA float.
107 public abstract void read_float_array(float[] value, int offset, int length);
110 * Read a CORBA <code>long</code> that is mapped into java <code>int</code>.
111 * @return an integer, corresponding the CORBA <code>long</code>.
113 public abstract int read_long();
116 * Read a CORBA <code>long long</code> that is mapped into java <code>
117 * long</code>.
118 * @return a value, corresponding the CORBA <code>long long</code>
120 public abstract long read_longlong();
123 * Read an array of CORBA <code>long long</code>
125 public abstract void read_longlong_array(long[] value, int offset, int length);
128 * Read a CORBA <code>octed</code> that is mapped into java <code>byte</code>.
129 * @return a byte, corresponding the CORBA <code>octet</code>.
131 public abstract byte read_octet();
134 * Read a and array of CORBA octets that are mapped into java array of
135 * bytes.
137 public abstract void read_octet_array(byte[] value, int offset, int length);
140 * Read a CORBA <code>short</code>.
141 * @return a value, corresponding the value of the CORBA <code>short</code>.
143 public abstract short read_short();
145 public abstract void read_short_array(short[] value, int offset, int length);
148 * Read a CORBA unsigned long that is mapped into java <code>int</code>.
149 * @return an integer, matching the CORBA unsigned <code>long</code>.
151 public abstract int read_ulong();
154 * Read an array of CORBA unsigned long.
156 public abstract void read_ulong_array(int[] value, int offset, int length);
159 * Should read from the stream, but following specification it does not.
160 * @throws java.io.IOException
161 * @throws NO_IMPLEMENT, always.
163 public int read()
164 throws java.io.IOException
166 throw new NO_IMPLEMENT();
170 * Read a TypeCode.
171 * @return a TypeCode.
173 public abstract TypeCode read_TypeCode();
176 * Read a CORBA <code>boolean</code>.
177 * @return a value, corresponding the value of the CORBA <code>boolean</code>.
179 public abstract boolean read_boolean();
182 * Read a and array of CORBA boolean values.
184 public abstract void read_boolean_array(boolean[] value, int offset,
185 int length
189 * Read a and array of CORBA characters.
191 public abstract void read_char_array(char[] value, int offset, int length);
194 * Read a and array of CORBA doubles.
196 public abstract void read_double_array(double[] value, int offset, int length);
199 * Read a and array of CORBA longs.
201 public abstract void read_long_array(int[] value, int offset, int length);
204 * Read a CORBA <code>string</code> that is mapped into java
205 * <code>String</code>.
206 * @return a value, corresponding the value of the CORBA
207 * <code>string</code>.
209 public abstract String read_string();
212 * Read a and array of CORBA unsigned longs.
214 public abstract long read_ulonglong();
217 * Read a and array of CORBA unsigned longs.
219 public abstract void read_ulonglong_array(long[] value, int offset, int length);
222 * Read a CORBA unsigned short that is mapped into java <code>short</code>.
223 * @return a value of the CORBA unsigned <code>short</code>.
225 public abstract short read_ushort();
228 * Read a and array of CORBA unsigned shorts.
230 public abstract void read_ushort_array(short[] value, int offset, int length);
233 * Read a CORBA object that is an instance of the class, passed
234 * as an argument. This method is not abstract, but following the
235 * specifications it must not be implemented.
237 * @param klass a CORBA class
238 * @throws NO_IMPLEMENT, always.
240 @SuppressWarnings("rawtypes") // Needed for API compatibility
241 public Object read_Object(Class klass)
243 throw new NO_IMPLEMENT();
247 * Read a CORBA <code>Any</code>.
248 * @return an <code>Any</code>.
250 public abstract Any read_any();
253 * Read a CORBA <code>fixed</code>. This method is not abstract,
254 * but following the specifications it must not be implemented.
256 * @throws NO_IMPLEMENT, always.
258 public BigDecimal read_fixed()
260 throw new NO_IMPLEMENT();
264 * Read a CORBA <code>wchar</code> that is mapped into java <code>char</code>.
265 * @return a value, corresponding the value of the CORBA <code>wchar</code>.
267 public abstract char read_wchar();
269 public abstract void read_wchar_array(char[] value, int offset, int length);
272 * Read a CORBA <code>wstring</code> that is mapped into
273 * java <code>String</code>.
274 * @return a string, corresponding CORBA <code>wstring</code>.
276 public abstract String read_wstring();
279 * Read a CORBA <code>Principal</code>.
280 * @deprecated by CORBA 2.2
281 * @return a Principal.
283 public Principal read_Principal()
285 throw new NO_IMPLEMENT();