001 /* DataInputStream.java -- 002 Copyright (C) 2005 Free Software Foundation, Inc. 003 004 This file is part of GNU Classpath. 005 006 GNU Classpath is free software; you can redistribute it and/or modify 007 it under the terms of the GNU General Public License as published by 008 the Free Software Foundation; either version 2, or (at your option) 009 any later version. 010 011 GNU Classpath is distributed in the hope that it will be useful, but 012 WITHOUT ANY WARRANTY; without even the implied warranty of 013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 General Public License for more details. 015 016 You should have received a copy of the GNU General Public License 017 along with GNU Classpath; see the file COPYING. If not, write to the 018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 019 02110-1301 USA. 020 021 Linking this library statically or dynamically with other modules is 022 making a combined work based on this library. Thus, the terms and 023 conditions of the GNU General Public License cover the whole 024 combination. 025 026 As a special exception, the copyright holders of this library give you 027 permission to link this library with independent modules to produce an 028 executable, regardless of the license terms of these independent 029 modules, and to copy and distribute the resulting executable under 030 terms of your choice, provided that you also meet, for each linked 031 independent module, the terms and conditions of the license of that 032 module. An independent module is a module which is not derived from 033 or based on this library. If you modify this library, you may extend 034 this exception to your version of the library, but you are not 035 obligated to do so. If you do not wish to do so, delete this 036 exception statement from your version. */ 037 038 039 package org.omg.CORBA; 040 041 import org.omg.CORBA.portable.ValueBase; 042 043 /** 044 * An interface for reading the custom value types. A value type, providing 045 * its own mechanism for reading the content, must implement 046 * the {@link CustomValue} that uses this interface. 047 * 048 * @see CustomValue 049 * @see CustomMarshal 050 * 051 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) 052 */ 053 public interface DataInputStream 054 extends ValueBase 055 { 056 /** 057 * Read {@link Any}. 058 * @return a value, extracted from the stream. 059 */ 060 Any read_any(); 061 062 /** 063 * Read boolean. 064 * @return a value, extracted from the stream. 065 */ 066 boolean read_boolean(); 067 068 /** 069 * Read narrow (usually 8 bit) char. 070 * @return a value, extracted from the stream. 071 */ 072 char read_char(); 073 074 /** 075 * Read wide (usually 16 bit) char. 076 * @return a value, extracted from the stream. 077 */ 078 char read_wchar(); 079 080 /** 081 * Read octet (byte). 082 * @return a value, extracted from the stream. 083 */ 084 byte read_octet(); 085 086 /** 087 * Read short (16 bit int). 088 * @return a value, extracted from the stream. 089 */ 090 short read_short(); 091 092 /** 093 * Read unsigned short. 094 * @return a value, extracted from the stream. 095 */ 096 short read_ushort(); 097 098 /** 099 * Read CORBA long (java int, 32 bits). 100 * @return a value, extracted from the stream. 101 */ 102 int read_long(); 103 104 /** 105 * Read CORBA unsigned long (java int). 106 * @return a value, extracted from the stream. 107 */ 108 int read_ulong(); 109 110 /** 111 * Read CORBA long long (java long, 64 bits). 112 * @return a value, extracted from the stream. 113 */ 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 */ 120 long read_ulonglong(); 121 122 /** 123 * Read float. 124 * @return a value, extracted from the stream. 125 */ 126 float read_float(); 127 128 /** 129 * Read dobule. 130 * @return a value, extracted from the stream. 131 */ 132 double read_double(); 133 134 /** 135 * Read narrow string (usually 8 bits per character). 136 * @return a value, extracted from the stream. 137 */ 138 String read_string(); 139 140 /** 141 * Read wide string (usually 16 bits per character). 142 * @return a value, extracted from the stream. 143 */ 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 */ 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 */ 160 java.lang.Object read_Abstract(); 161 162 /** 163 * Read the CORBA value type. 164 * @return a value, extracted from the stream. 165 */ 166 java.io.Serializable read_Value(); 167 168 /** 169 * Read typecode. 170 * @return a value, extracted from the stream. 171 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 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 */ 275 void read_double_array(DoubleSeqHolder seq, int offset, int length); 276 }