InputStream.java revision 608:7e06bf1dcb09
1/*
2 * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25package org.omg.CORBA.portable;
26
27import org.omg.CORBA.TypeCode;
28import org.omg.CORBA.Principal;
29import org.omg.CORBA.Any;
30
31/**
32 * InputStream is the Java API for reading IDL types
33 * from CDR marshal streams. These methods are used by the ORB to
34 * unmarshal IDL types as well as to extract IDL types out of Anys.
35 * The <code>_array</code> versions of the methods can be directly
36 * used to read sequences and arrays of IDL types.
37 *
38 * @since   JDK1.2
39 */
40
41public abstract class InputStream extends java.io.InputStream
42{
43    /**
44     * Reads a boolean value from this input stream.
45     *
46     * @return the <code>boolean</code> value read from this input stream
47     */
48    public abstract boolean     read_boolean();
49    /**
50     * Reads a char value from this input stream.
51     *
52     * @return the <code>char</code> value read from this input stream
53     */
54    public abstract char        read_char();
55    /**
56     * Reads a wide char value from this input stream.
57     *
58     * @return the <code>char</code> value read from this input stream
59     */
60    public abstract char        read_wchar();
61    /**
62     * Reads an octet (that is, a byte) value from this input stream.
63     *
64     * @return the <code>byte</code> value read from this input stream
65     */
66    public abstract byte        read_octet();
67    /**
68     * Reads a short value from this input stream.
69     *
70     * @return the <code>short</code> value read from this input stream
71     */
72    public abstract short       read_short();
73    /**
74     * Reads a unsigned short value from this input stream.
75     *
76     * @return the <code>short</code> value read from this input stream
77     */
78    public abstract short       read_ushort();
79    /**
80     * Reads a CORBA long (that is, Java int) value from this input stream.
81     *
82     * @return the <code>int</code> value read from this input stream
83     */
84    public abstract int         read_long();
85    /**
86     * Reads an unsigned CORBA long (that is, Java int) value from this input
87stream.
88     *
89     * @return the <code>int</code> value read from this input stream
90     */
91    public abstract int         read_ulong();
92    /**
93     * Reads a CORBA longlong (that is, Java long) value from this input stream.
94     *
95     * @return the <code>long</code> value read from this input stream
96     */
97    public abstract long        read_longlong();
98    /**
99     * Reads a CORBA unsigned longlong (that is, Java long) value from this input
100stream.
101     *
102     * @return the <code>long</code> value read from this input stream
103     */
104    public abstract long        read_ulonglong();
105    /**
106     * Reads a float value from this input stream.
107     *
108     * @return the <code>float</code> value read from this input stream
109     */
110    public abstract float       read_float();
111    /**
112     * Reads a double value from this input stream.
113     *
114     * @return the <code>double</code> value read from this input stream
115     */
116    public abstract double      read_double();
117    /**
118     * Reads a string value from this input stream.
119     *
120     * @return the <code>String</code> value read from this input stream
121     */
122    public abstract String      read_string();
123    /**
124     * Reads a wide string value from this input stream.
125     *
126     * @return the <code>String</code> value read from this input stream
127     */
128    public abstract String      read_wstring();
129
130    /**
131     * Reads an array of booleans from this input stream.
132     * @param value returned array of booleans.
133     * @param offset offset on the stream.
134     * @param length length of buffer to read.
135     */
136    public abstract void        read_boolean_array(boolean[] value, int offset, int
137length);
138    /**
139     * Reads an array of chars from this input stream.
140     * @param value returned array of chars.
141     * @param offset offset on the stream.
142     * @param length length of buffer to read.
143     */
144    public abstract void        read_char_array(char[] value, int offset, int
145length);
146    /**
147     * Reads an array of wide chars from this input stream.
148     * @param value returned array of wide chars.
149     * @param offset offset on the stream.
150     * @param length length of buffer to read.
151     */
152    public abstract void        read_wchar_array(char[] value, int offset, int
153length);
154    /**
155     * Reads an array of octets (that is, bytes) from this input stream.
156     * @param value returned array of octets (that is, bytes).
157     * @param offset offset on the stream.
158     * @param length length of buffer to read.
159     */
160    public abstract void        read_octet_array(byte[] value, int offset, int
161length);
162    /**
163     * Reads an array of shorts from this input stream.
164     * @param value returned array of shorts.
165     * @param offset offset on the stream.
166     * @param length length of buffer to read.
167     */
168    public abstract void        read_short_array(short[] value, int offset, int
169length);
170    /**
171     * Reads an array of unsigned shorts from this input stream.
172     * @param value returned array of shorts.
173     * @param offset offset on the stream.
174     * @param length length of buffer to read.
175     */
176    public abstract void        read_ushort_array(short[] value, int offset, int
177length);
178    /**
179     * Reads an array of CORBA longs (that is, Java ints) from this input stream.
180     * @param value returned array of CORBA longs (that is, Java ints).
181     * @param offset offset on the stream.
182     * @param length length of buffer to read.
183     */
184    public abstract void        read_long_array(int[] value, int offset, int
185length);
186    /**
187     * Reads an array of unsigned CORBA longs (that is, Java ints) from this input
188stream.
189     * @param value returned array of CORBA longs (that is, Java ints).
190     * @param offset offset on the stream.
191     * @param length length of buffer to read.
192     */
193    public abstract void        read_ulong_array(int[] value, int offset, int
194length);
195    /**
196     * Reads an array of CORBA longlongs (that is, Java longs) from this input
197stream.
198     * @param value returned array of CORBA longs (that is, Java longs).
199     * @param offset offset on the stream.
200     * @param length length of buffer to read.
201     */
202    public abstract void        read_longlong_array(long[] value, int offset, int
203length);
204    /**
205     * Reads an array of unsigned CORBA longlongs (that is, Java longs) from this
206input stream.
207     * @param value returned array of CORBA longs (that is, Java longs).
208     * @param offset offset on the stream.
209     * @param length length of buffer to read.
210     */
211    public abstract void        read_ulonglong_array(long[] value, int offset, int
212length);
213    /**
214     * Reads an array of floats from this input stream.
215     * @param value returned array of floats.
216     * @param offset offset on the stream.
217     * @param length length of buffer to read.
218     */
219    public abstract void        read_float_array(float[] value, int offset, int
220length);
221    /**
222     * Reads an array of doubles from this input stream.
223     * @param value returned array of doubles.
224     * @param offset offset on the stream.
225     * @param length length of buffer to read.
226     */
227    public abstract void        read_double_array(double[] value, int offset, int
228length);
229
230    /**
231     * Reads a CORBA object from this input stream.
232     *
233     * @return the <code>Object</code> instance read from this input stream.
234     */
235    public abstract org.omg.CORBA.Object read_Object();
236    /**
237     * Reads a <code>TypeCode</code> from this input stream.
238     *
239     * @return the <code>TypeCode</code> instance read from this input stream.
240     */
241    public abstract TypeCode    read_TypeCode();
242    /**
243     * Reads an Any from this input stream.
244     *
245     * @return the <code>Any</code> instance read from this input stream.
246     */
247    public abstract Any         read_any();
248
249    /**
250     * Returns principal for invocation.
251     * @return Principal for invocation.
252     * @deprecated Deprecated by CORBA 2.2.
253     */
254    @Deprecated
255    public  Principal   read_Principal() {
256        throw new org.omg.CORBA.NO_IMPLEMENT();
257    }
258
259
260    /**
261     * @see <a href="package-summary.html#unimpl"><code>portable</code>
262     * package comments for unimplemented features</a>
263     */
264    public int read() throws java.io.IOException {
265        throw new org.omg.CORBA.NO_IMPLEMENT();
266    }
267
268    /**
269     * Reads a BigDecimal number.
270     * @return a java.math.BigDecimal number
271     */
272    public java.math.BigDecimal read_fixed() {
273        throw new org.omg.CORBA.NO_IMPLEMENT();
274    }
275
276    /**
277     * Reads a CORBA context from the stream.
278     * @return a CORBA context
279     * @see <a href="package-summary.html#unimpl"><code>portable</code>
280     * package comments for unimplemented features</a>
281     */
282    public org.omg.CORBA.Context read_Context() {
283        throw new org.omg.CORBA.NO_IMPLEMENT();
284    }
285    /*
286     * The following methods were added by orbos/98-04-03: Java to IDL
287     * Mapping. These are used by RMI over IIOP.
288     */
289
290    /**
291     * Unmarshals an object and returns a CORBA Object,
292     * which is an instance of the class passed as its argument.
293     * This class is the stub class of the expected type.
294     *
295     * @param clz  The Class object for the stub class which
296     * corresponds to the type that is statistically expected, or
297     * the Class object for the RMI/IDL interface type that
298     * is statistically expected.
299     * @return an Object instance of clz read from this stream
300     *
301     * @see <a href="package-summary.html#unimpl"><code>portable</code>
302     * package comments for unimplemented features</a>
303     */
304    public  org.omg.CORBA.Object read_Object(java.lang.Class
305                                             clz) {
306        throw new org.omg.CORBA.NO_IMPLEMENT();
307    }
308
309    /**
310     * Returns the ORB that created this InputStream.
311     *
312     * @return the <code>ORB</code> object that created this stream
313     *
314     * @see <a href="package-summary.html#unimpl"><code>portable</code>
315     * package comments for unimplemented features</a>
316     */
317    public org.omg.CORBA.ORB orb() {
318        throw new org.omg.CORBA.NO_IMPLEMENT();
319    }
320}
321