1 /* DataInputStream.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; 40 41 import org.omg.CORBA.portable.ValueBase; 42 43 /** 44 * An interface for reading the custom value types. A value type, providing 45 * its own mechanism for reading the content, must implement 46 * the {@link CustomValue} that uses this interface. 47 * 48 * @see CustomValue 49 * @see CustomMarshal 50 * 51 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) 52 */ 53 public interface DataInputStream 54 extends ValueBase 55 { 56 /** 57 * Read {@link Any}. 58 * @return a value, extracted from the stream. 59 */ read_any()60 Any read_any(); 61 62 /** 63 * Read boolean. 64 * @return a value, extracted from the stream. 65 */ read_boolean()66 boolean read_boolean(); 67 68 /** 69 * Read narrow (usually 8 bit) char. 70 * @return a value, extracted from the stream. 71 */ read_char()72 char read_char(); 73 74 /** 75 * Read wide (usually 16 bit) char. 76 * @return a value, extracted from the stream. 77 */ read_wchar()78 char read_wchar(); 79 80 /** 81 * Read octet (byte). 82 * @return a value, extracted from the stream. 83 */ read_octet()84 byte read_octet(); 85 86 /** 87 * Read short (16 bit int). 88 * @return a value, extracted from the stream. 89 */ read_short()90 short read_short(); 91 92 /** 93 * Read unsigned short. 94 * @return a value, extracted from the stream. 95 */ read_ushort()96 short read_ushort(); 97 98 /** 99 * Read CORBA long (java int, 32 bits). 100 * @return a value, extracted from the stream. 101 */ read_long()102 int read_long(); 103 104 /** 105 * Read CORBA unsigned long (java int). 106 * @return a value, extracted from the stream. 107 */ read_ulong()108 int read_ulong(); 109 110 /** 111 * Read CORBA long long (java long, 64 bits). 112 * @return a value, extracted from the stream. 113 */ read_longlong()114 long read_longlong(); 115 116 /** 117 * Read unsigned CORBA long long (java long, 64 bits). 118 * @return a value, extracted from the stream. 119 */ read_ulonglong()120 long read_ulonglong(); 121 122 /** 123 * Read float. 124 * @return a value, extracted from the stream. 125 */ read_float()126 float read_float(); 127 128 /** 129 * Read dobule. 130 * @return a value, extracted from the stream. 131 */ read_double()132 double read_double(); 133 134 /** 135 * Read narrow string (usually 8 bits per character). 136 * @return a value, extracted from the stream. 137 */ read_string()138 String read_string(); 139 140 /** 141 * Read wide string (usually 16 bits per character). 142 * @return a value, extracted from the stream. 143 */ read_wstring()144 String read_wstring(); 145 146 /** 147 * Read CORBA object. 148 * 149 * @return a value, extracted from the stream. May be null 150 * if the null was previously written by {@link DataOutputStream#write_Object}. 151 */ read_Object()152 org.omg.CORBA.Object read_Object(); 153 154 /** 155 * Read abstract interface. 156 * 157 * @return a value, extracted from the stream. May be either CORBA Object or 158 * CORBA value type. 159 */ read_Abstract()160 java.lang.Object read_Abstract(); 161 162 /** 163 * Read the CORBA value type. 164 * @return a value, extracted from the stream. 165 */ read_Value()166 java.io.Serializable read_Value(); 167 168 /** 169 * Read typecode. 170 * @return a value, extracted from the stream. 171 */ read_TypeCode()172 TypeCode read_TypeCode(); 173 174 /** 175 * Read array of Any's. 176 * 177 * The value, extracted from the stream, is returned in the 178 * .value field of the passed holder. 179 */ read_any_array(AnySeqHolder seq, int offset, int length)180 void read_any_array(AnySeqHolder seq, int offset, int length); 181 182 /** 183 * Read boolean array. 184 * The value, extracted from the stream, is returned in the 185 * .value field of the passed holder. 186 */ read_boolean_array(BooleanSeqHolder seq, int offset, int length)187 void read_boolean_array(BooleanSeqHolder seq, int offset, int length); 188 189 /** 190 * Read array of narrow (usually 8 bit) chars. 191 * 192 * The value, extracted from the stream, is returned in the 193 * .value field of the passed holder. 194 */ read_char_array(CharSeqHolder seq, int offset, int length)195 void read_char_array(CharSeqHolder seq, int offset, int length); 196 197 /** 198 * Read array of wide (usually 16 bit) chars. 199 * 200 * The value, extracted from the stream, is returned in the 201 * .value field of the passed holder. 202 */ read_wchar_array(WCharSeqHolder seq, int offset, int length)203 void read_wchar_array(WCharSeqHolder seq, int offset, int length); 204 205 /** 206 * Read array of bytes. 207 * 208 * The value, extracted from the stream, is returned in the 209 * .value field of the passed holder. 210 */ read_octet_array(OctetSeqHolder seq, int offset, int length)211 void read_octet_array(OctetSeqHolder seq, int offset, int length); 212 213 /** 214 * Read array of shorts (16 bit ints). 215 * 216 * The value, extracted from the stream, is returned in the 217 * .value field of the passed holder. 218 */ read_short_array(ShortSeqHolder seq, int offset, int length)219 void read_short_array(ShortSeqHolder seq, int offset, int length); 220 221 /** 222 * Read array of unsigned shorts (16 bit ints). 223 * 224 * The value, extracted from the stream, is returned in the 225 * .value field of the passed holder. 226 */ read_ushort_array(UShortSeqHolder seq, int offset, int length)227 void read_ushort_array(UShortSeqHolder seq, int offset, int length); 228 229 /** 230 * Read array of CORBA longs (java ints). 231 * 232 * The value, extracted from the stream, is returned in the 233 * .value field of the passed holder. 234 */ read_long_array(LongSeqHolder seq, int offset, int length)235 void read_long_array(LongSeqHolder seq, int offset, int length); 236 237 /** 238 * Read array of CORBA unsigned longs (java ints). 239 * 240 * The value, extracted from the stream, is returned in the 241 * .value field of the passed holder. 242 */ read_ulong_array(ULongSeqHolder seq, int offset, int length)243 void read_ulong_array(ULongSeqHolder seq, int offset, int length); 244 245 /** 246 * Read array of CORBA unsigned long longs (java longs). 247 * 248 * The value, extracted from the stream, is returned in the 249 * .value field of the passed holder. 250 */ read_ulonglong_array(ULongLongSeqHolder seq, int offset, int length)251 void read_ulonglong_array(ULongLongSeqHolder seq, int offset, int length); 252 253 /** 254 * Read array of CORBA long longs (java longs). 255 * 256 * The value, extracted from the stream, is returned in the 257 * .value field of the passed holder. 258 */ read_longlong_array(LongLongSeqHolder seq, int offset, int length)259 void read_longlong_array(LongLongSeqHolder seq, int offset, int length); 260 261 /** 262 * Read array of floats. 263 * 264 * The value, extracted from the stream, is returned in the 265 * .value field of the passed holder. 266 */ read_float_array(FloatSeqHolder seq, int offset, int length)267 void read_float_array(FloatSeqHolder seq, int offset, int length); 268 269 /** 270 * Read array of doubles. 271 * 272 * The value, extracted from the stream, is returned in the 273 * .value field of the passed holder. 274 */ read_double_array(DoubleSeqHolder seq, int offset, int length)275 void read_double_array(DoubleSeqHolder seq, int offset, int length); 276 } 277