1 /* InputStream.java -- 2 Copyright (C) 2005 Free Software Foundation, Inc. 3 4 This file is part of GNU Classpath. 5 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. 10 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. 15 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. 20 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. 25 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. */ 37 38 39 package org.omg.CORBA.portable; 40 41 import java.math.BigDecimal; 42 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; 50 51 /** 52 * This class is used to read CORBA IDL data types. 53 * 54 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org) 55 */ 56 public abstract class InputStream 57 extends java.io.InputStream 58 { 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. 63 */ orb()64 public ORB orb() 65 { 66 return null; 67 } 68 69 /** 70 * This should read the CORBA context, but following the 1.4 API 71 * specification, it must not be implemented. 72 * 73 * @throws NO_IMPLEMENT, always. 74 */ read_Context()75 public Context read_Context() 76 { 77 throw new NO_IMPLEMENT(); 78 } 79 80 /** 81 * Read a CORBA (not java) object 82 * @return an object. 83 */ read_Object()84 public abstract org.omg.CORBA.Object read_Object(); 85 86 /** 87 * Read a CORBA <code>char</code>. 88 * @return a value, corresponding the value of the CORBA <code>char</code>. 89 */ read_char()90 public abstract char read_char(); 91 92 /** 93 * Read a CORBA <code>double</code>. 94 * @return a value, corresponding the value of the CORBA <code>double</code>. 95 */ read_double()96 public abstract double read_double(); 97 98 /** 99 * Read a CORBA <code>float</code>. 100 * @return a value, corresponding the value of the CORBA <code>float</code>. 101 */ read_float()102 public abstract float read_float(); 103 104 /** 105 * Read a and array of CORBA float. 106 */ read_float_array(float[] value, int offset, int length)107 public abstract void read_float_array(float[] value, int offset, int length); 108 109 /** 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>. 112 */ read_long()113 public abstract int read_long(); 114 115 /** 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> 119 */ read_longlong()120 public abstract long read_longlong(); 121 122 /** 123 * Read an array of CORBA <code>long long</code> 124 */ read_longlong_array(long[] value, int offset, int length)125 public abstract void read_longlong_array(long[] value, int offset, int length); 126 127 /** 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>. 130 */ read_octet()131 public abstract byte read_octet(); 132 133 /** 134 * Read a and array of CORBA octets that are mapped into java array of 135 * bytes. 136 */ read_octet_array(byte[] value, int offset, int length)137 public abstract void read_octet_array(byte[] value, int offset, int length); 138 139 /** 140 * Read a CORBA <code>short</code>. 141 * @return a value, corresponding the value of the CORBA <code>short</code>. 142 */ read_short()143 public abstract short read_short(); 144 read_short_array(short[] value, int offset, int length)145 public abstract void read_short_array(short[] value, int offset, int length); 146 147 /** 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>. 150 */ read_ulong()151 public abstract int read_ulong(); 152 153 /** 154 * Read an array of CORBA unsigned long. 155 */ read_ulong_array(int[] value, int offset, int length)156 public abstract void read_ulong_array(int[] value, int offset, int length); 157 158 /** 159 * Should read from the stream, but following specification it does not. 160 * @throws java.io.IOException 161 * @throws NO_IMPLEMENT, always. 162 */ read()163 public int read() 164 throws java.io.IOException 165 { 166 throw new NO_IMPLEMENT(); 167 } 168 169 /** 170 * Read a TypeCode. 171 * @return a TypeCode. 172 */ read_TypeCode()173 public abstract TypeCode read_TypeCode(); 174 175 /** 176 * Read a CORBA <code>boolean</code>. 177 * @return a value, corresponding the value of the CORBA <code>boolean</code>. 178 */ read_boolean()179 public abstract boolean read_boolean(); 180 181 /** 182 * Read a and array of CORBA boolean values. 183 */ read_boolean_array(boolean[] value, int offset, int length )184 public abstract void read_boolean_array(boolean[] value, int offset, 185 int length 186 ); 187 188 /** 189 * Read a and array of CORBA characters. 190 */ read_char_array(char[] value, int offset, int length)191 public abstract void read_char_array(char[] value, int offset, int length); 192 193 /** 194 * Read a and array of CORBA doubles. 195 */ read_double_array(double[] value, int offset, int length)196 public abstract void read_double_array(double[] value, int offset, int length); 197 198 /** 199 * Read a and array of CORBA longs. 200 */ read_long_array(int[] value, int offset, int length)201 public abstract void read_long_array(int[] value, int offset, int length); 202 203 /** 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>. 208 */ read_string()209 public abstract String read_string(); 210 211 /** 212 * Read a and array of CORBA unsigned longs. 213 */ read_ulonglong()214 public abstract long read_ulonglong(); 215 216 /** 217 * Read a and array of CORBA unsigned longs. 218 */ read_ulonglong_array(long[] value, int offset, int length)219 public abstract void read_ulonglong_array(long[] value, int offset, int length); 220 221 /** 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>. 224 */ read_ushort()225 public abstract short read_ushort(); 226 227 /** 228 * Read a and array of CORBA unsigned shorts. 229 */ read_ushort_array(short[] value, int offset, int length)230 public abstract void read_ushort_array(short[] value, int offset, int length); 231 232 /** 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. 236 * 237 * @param klass a CORBA class 238 * @throws NO_IMPLEMENT, always. 239 */ 240 @SuppressWarnings("rawtypes") // Needed for API compatibility read_Object(Class klass)241 public Object read_Object(Class klass) 242 { 243 throw new NO_IMPLEMENT(); 244 } 245 246 /** 247 * Read a CORBA <code>Any</code>. 248 * @return an <code>Any</code>. 249 */ read_any()250 public abstract Any read_any(); 251 252 /** 253 * Read a CORBA <code>fixed</code>. This method is not abstract, 254 * but following the specifications it must not be implemented. 255 * 256 * @throws NO_IMPLEMENT, always. 257 */ read_fixed()258 public BigDecimal read_fixed() 259 { 260 throw new NO_IMPLEMENT(); 261 } 262 263 /** 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>. 266 */ read_wchar()267 public abstract char read_wchar(); 268 read_wchar_array(char[] value, int offset, int length)269 public abstract void read_wchar_array(char[] value, int offset, int length); 270 271 /** 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>. 275 */ read_wstring()276 public abstract String read_wstring(); 277 278 /** 279 * Read a CORBA <code>Principal</code>. 280 * @deprecated by CORBA 2.2 281 * @return a Principal. 282 */ read_Principal()283 public Principal read_Principal() 284 { 285 throw new NO_IMPLEMENT(); 286 } 287 } 288