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