1. /*
  2. * @(#)InputStream.java 1.33 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA.portable;
  8. import org.omg.CORBA.TypeCode;
  9. import org.omg.CORBA.Principal;
  10. import org.omg.CORBA.Any;
  11. /**
  12. * InputStream is the Java API for reading IDL types
  13. * from CDR marshal streams. These methods are used by the ORB to
  14. * unmarshal IDL types as well as to extract IDL types out of Anys.
  15. * The <code>_array</code> versions of the methods can be directly
  16. * used to read sequences and arrays of IDL types.
  17. *
  18. * @version 1.12, 04/22/98
  19. * @since JDK1.2
  20. */
  21. public abstract class InputStream extends java.io.InputStream
  22. {
  23. /**
  24. * Reads a boolean value from this input stream.
  25. *
  26. * @return the <code>boolean</code> value read from this input stream
  27. */
  28. public abstract boolean read_boolean();
  29. /**
  30. * Reads a char value from this input stream.
  31. *
  32. * @return the <code>char</code> value read from this input stream
  33. */
  34. public abstract char read_char();
  35. /**
  36. * Reads a wide char value from this input stream.
  37. *
  38. * @return the <code>char</code> value read from this input stream
  39. */
  40. public abstract char read_wchar();
  41. /**
  42. * Reads an octet (that is, a byte) value from this input stream.
  43. *
  44. * @return the <code>byte</code> value read from this input stream
  45. */
  46. public abstract byte read_octet();
  47. /**
  48. * Reads a short value from this input stream.
  49. *
  50. * @return the <code>short</code> value read from this input stream
  51. */
  52. public abstract short read_short();
  53. /**
  54. * Reads a unsigned short value from this input stream.
  55. *
  56. * @return the <code>short</code> value read from this input stream
  57. */
  58. public abstract short read_ushort();
  59. /**
  60. * Reads a CORBA long (that is, Java int) value from this input stream.
  61. *
  62. * @return the <code>int</code> value read from this input stream
  63. */
  64. public abstract int read_long();
  65. /**
  66. * Reads an unsigned CORBA long (that is, Java int) value from this input
  67. stream.
  68. *
  69. * @return the <code>int</code> value read from this input stream
  70. */
  71. public abstract int read_ulong();
  72. /**
  73. * Reads a CORBA longlong (that is, Java long) value from this input stream.
  74. *
  75. * @return the <code>long</code> value read from this input stream
  76. */
  77. public abstract long read_longlong();
  78. /**
  79. * Reads a CORBA unsigned longlong (that is, Java long) value from this input
  80. stream.
  81. *
  82. * @return the <code>long</code> value read from this input stream
  83. */
  84. public abstract long read_ulonglong();
  85. /**
  86. * Reads a float value from this input stream.
  87. *
  88. * @return the <code>float</code> value read from this input stream
  89. */
  90. public abstract float read_float();
  91. /**
  92. * Reads a double value from this input stream.
  93. *
  94. * @return the <code>double</code> value read from this input stream
  95. */
  96. public abstract double read_double();
  97. /**
  98. * Reads a string value from this input stream.
  99. *
  100. * @return the <code>String</code> value read from this input stream
  101. */
  102. public abstract String read_string();
  103. /**
  104. * Reads a wide string value from this input stream.
  105. *
  106. * @return the <code>String</code> value read from this input stream
  107. */
  108. public abstract String read_wstring();
  109. /**
  110. * Reads an array of booleans from this input stream.
  111. * @param value returned array of booleans.
  112. * @param offset offset on the stream.
  113. * @param length length of buffer to read
  114. */
  115. public abstract void read_boolean_array(boolean[] value, int offset, int
  116. length);
  117. /**
  118. * Reads an array of chars from this input stream.
  119. * @param value returned array of chars.
  120. * @param offset offset on the stream.
  121. * @param length length of buffer to read
  122. */
  123. public abstract void read_char_array(char[] value, int offset, int
  124. length);
  125. /**
  126. * Reads an array of wide chars from this input stream.
  127. * @param value returned array of wide chars.
  128. * @param offset offset on the stream.
  129. * @param length length of buffer to read
  130. */
  131. public abstract void read_wchar_array(char[] value, int offset, int
  132. length);
  133. /**
  134. * Reads an array of octets (that is, bytes) from this input stream.
  135. * @param value returned array of octets (that is, bytes).
  136. * @param offset offset on the stream.
  137. * @param length length of buffer to read
  138. */
  139. public abstract void read_octet_array(byte[] value, int offset, int
  140. length);
  141. /**
  142. * Reads an array of shorts from this input stream.
  143. * @param value returned array of shorts.
  144. * @param offset offset on the stream.
  145. * @param length length of buffer to read
  146. */
  147. public abstract void read_short_array(short[] value, int offset, int
  148. length);
  149. /**
  150. * Reads an array of unsigned shorts from this input stream.
  151. * @param value returned array of shorts.
  152. * @param offset offset on the stream.
  153. * @param length length of buffer to read
  154. */
  155. public abstract void read_ushort_array(short[] value, int offset, int
  156. length);
  157. /**
  158. * Reads an array of CORBA longs (that is, Java ints) from this input stream.
  159. * @param value returned array of CORBA longs (that is, Java ints).
  160. * @param offset offset on the stream.
  161. * @param length length of buffer to read
  162. */
  163. public abstract void read_long_array(int[] value, int offset, int
  164. length);
  165. /**
  166. * Reads an array of unsigned CORBA longs (that is, Java ints) from this input
  167. stream.
  168. * @param value returned array of CORBA longs (that is, Java ints).
  169. * @param offset offset on the stream.
  170. * @param length length of buffer to read
  171. */
  172. public abstract void read_ulong_array(int[] value, int offset, int
  173. length);
  174. /**
  175. * Reads an array of CORBA longlongs (that is, Java longs) from this input
  176. stream.
  177. * @param value returned array of CORBA longs (that is, Java longs).
  178. * @param offset offset on the stream.
  179. * @param length length of buffer to read
  180. */
  181. public abstract void read_longlong_array(long[] value, int offset, int
  182. length);
  183. /**
  184. * Reads an array of unsigned CORBA longlongs (that is, Java longs) from this
  185. input stream.
  186. * @param value returned array of CORBA longs (that is, Java longs).
  187. * @param offset offset on the stream.
  188. * @param length length of buffer to read
  189. */
  190. public abstract void read_ulonglong_array(long[] value, int offset, int
  191. length);
  192. /**
  193. * Reads an array of floats from this input stream.
  194. * @param value returned array of floats.
  195. * @param offset offset on the stream.
  196. * @param length length of buffer to read
  197. */
  198. public abstract void read_float_array(float[] value, int offset, int
  199. length);
  200. /**
  201. * Reads an array of boubles from this input stream.
  202. * @param value returned array of doubles.
  203. * @param offset offset on the stream.
  204. * @param length length of buffer to read
  205. */
  206. public abstract void read_double_array(double[] value, int offset, int
  207. length);
  208. /**
  209. * Reads a CORBA object from this input stream.
  210. *
  211. * @return the <code>Object</code> instance read from this input stream
  212. */
  213. public abstract org.omg.CORBA.Object read_Object();
  214. /**
  215. * Reads a TypeCode from this input stream.
  216. *
  217. * @return the <code>TypeCode</code> instance read from this input stream
  218. */
  219. public abstract TypeCode read_TypeCode();
  220. /**
  221. * Reads an Any from this input stream.
  222. *
  223. * @return the <code>Any</code> instance read from this input stream
  224. */
  225. public abstract Any read_any();
  226. /**
  227. * Returns principle for invocation.
  228. * @return Principle for invocation
  229. * @deprecated Deprecated by CORBA 2.2.
  230. */
  231. public Principal read_Principal() {
  232. throw new org.omg.CORBA.NO_IMPLEMENT();
  233. }
  234. /**
  235. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  236. * package comments for unimplemented features</a>
  237. */
  238. public int read() throws java.io.IOException {
  239. throw new org.omg.CORBA.NO_IMPLEMENT();
  240. }
  241. /**
  242. * Reads a BigDecimal number.
  243. * @return a java.math.BigDecimal number
  244. */
  245. public java.math.BigDecimal read_fixed() {
  246. throw new org.omg.CORBA.NO_IMPLEMENT();
  247. }
  248. /**
  249. * Reads a CORBA context from the stream.
  250. * @return a CORBA context
  251. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  252. * package comments for unimplemented features</a>
  253. */
  254. public org.omg.CORBA.Context read_Context() {
  255. throw new org.omg.CORBA.NO_IMPLEMENT();
  256. }
  257. /*
  258. * The following methods were added by orbos/98-04-03: Java to IDL
  259. * Mapping. These are used by RMI over IIOP.
  260. */
  261. /**
  262. * Unmarshals an object and returns a CORBA Object,
  263. * which is an instance of the class passed as its argument.
  264. * This class is the stub class of the expected type.
  265. *
  266. * @param clz The Class object for the stub class which
  267. * corresponds to the type that is statistically expected, or
  268. * the Class object for the RMI/IDL interface type that
  269. * is statistically expected.
  270. * @return an Object instance of clz read from this stream
  271. *
  272. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  273. * package comments for unimplemented features</a>
  274. */
  275. public org.omg.CORBA.Object read_Object(java.lang.Class
  276. clz) {
  277. throw new org.omg.CORBA.NO_IMPLEMENT();
  278. }
  279. /**
  280. * Returns the ORB that created this InputStream.
  281. *
  282. * @return the <code>ORB</code> object that created this stream
  283. *
  284. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  285. * package comments for unimplemented features</a>
  286. */
  287. public org.omg.CORBA.ORB orb() {
  288. throw new org.omg.CORBA.NO_IMPLEMENT();
  289. }
  290. }