1. /*
  2. * @(#)OutputStream.java 1.26 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. * OuputStream is the Java API for writing IDL types
  16. * to CDR marshal streams. These methods are used by the ORB to
  17. * marshal IDL types as well as to insert IDL types into Anys.
  18. * The <code>_array</code> versions of the methods can be directly
  19. * used to write sequences and arrays of IDL types.
  20. *
  21. * @version 1.13, 04/22/98
  22. * @since JDK1.2
  23. */
  24. public abstract class OutputStream extends java.io.OutputStream
  25. {
  26. /**
  27. * Returns an input stream with the same buffer.
  28. *@return an input stream with the same buffer.
  29. */
  30. public abstract InputStream create_input_stream();
  31. /**
  32. * Writes a boolean value to this stream.
  33. * @param value the value to be written.
  34. */
  35. public abstract void write_boolean(boolean value);
  36. /**
  37. * Writes a char value to this stream.
  38. * @param value the value to be written.
  39. */
  40. public abstract void write_char(char value);
  41. /**
  42. * Writes a wide char value to this stream.
  43. * @param value the value to be written.
  44. */
  45. public abstract void write_wchar(char value);
  46. /**
  47. * Writes a CORBA octet (i.e. byte) value to this stream.
  48. * @param value the value to be written.
  49. */
  50. public abstract void write_octet(byte value);
  51. /**
  52. * Writes a short value to this stream.
  53. * @param value the value to be written.
  54. */
  55. public abstract void write_short(short value);
  56. /**
  57. * Writes an unsigned short value to this stream.
  58. * @param value the value to be written.
  59. */
  60. public abstract void write_ushort(short value);
  61. /**
  62. * Writes a CORBA long (i.e. Java int) value to this stream.
  63. * @param value the value to be written.
  64. */
  65. public abstract void write_long(int value);
  66. /**
  67. * Writes an unsigned CORBA long (i.e. Java int) value to this stream.
  68. * @param value the value to be written.
  69. */
  70. public abstract void write_ulong(int value);
  71. /**
  72. * Writes a CORBA longlong (i.e. Java long) value to this stream.
  73. * @param value the value to be written.
  74. */
  75. public abstract void write_longlong(long value);
  76. /**
  77. * Writes an unsigned CORBA longlong (i.e. Java long) value to this stream.
  78. * @param value the value to be written.
  79. */
  80. public abstract void write_ulonglong(long value);
  81. /**
  82. * Writes a float value to this stream.
  83. * @param value the value to be written.
  84. */
  85. public abstract void write_float(float value);
  86. /**
  87. * Writes a double value to this stream.
  88. * @param value the value to be written.
  89. */
  90. public abstract void write_double(double value);
  91. /**
  92. * Writes a string value to this stream.
  93. * @param value the value to be written.
  94. */
  95. public abstract void write_string(String value);
  96. /**
  97. * Writes a wide string value to this stream.
  98. * @param value the value to be written.
  99. */
  100. public abstract void write_wstring(String value);
  101. /**
  102. * Writes an array of booleans on this output stream.
  103. * @param value the array to be written.
  104. * @param offset offset on the stream.
  105. * @param length length of buffer to write.
  106. */
  107. public abstract void write_boolean_array(boolean[] value, int offset,
  108. int length);
  109. /**
  110. * Writes an array of chars on this output stream.
  111. * @param value the array to be written.
  112. * @param offset offset on the stream.
  113. * @param length length of buffer to write.
  114. */
  115. public abstract void write_char_array(char[] value, int offset,
  116. int length);
  117. /**
  118. * Writes an array of wide chars on this output stream.
  119. * @param value the array to be written.
  120. * @param offset offset on the stream.
  121. * @param length length of buffer to write.
  122. */
  123. public abstract void write_wchar_array(char[] value, int offset,
  124. int length);
  125. /**
  126. * Writes an array of CORBA octets (bytes) on this output stream.
  127. * @param value the array to be written.
  128. * @param offset offset on the stream.
  129. * @param length length of buffer to write.
  130. */
  131. public abstract void write_octet_array(byte[] value, int offset,
  132. int length);
  133. /**
  134. * Writes an array of shorts on this output stream.
  135. * @param value the array to be written.
  136. * @param offset offset on the stream.
  137. * @param length length of buffer to write.
  138. */
  139. public abstract void write_short_array(short[] value, int offset,
  140. int length);
  141. /**
  142. * Writes an array of unsigned shorts on this output stream.
  143. * @param value the array to be written.
  144. * @param offset offset on the stream.
  145. * @param length length of buffer to write.
  146. */
  147. public abstract void write_ushort_array(short[] value, int offset,
  148. int length);
  149. /**
  150. * Writes an array of CORBA longs (i.e. Java ints) on this output stream.
  151. * @param value the array to be written.
  152. * @param offset offset on the stream.
  153. * @param length length of buffer to write.
  154. */
  155. public abstract void write_long_array(int[] value, int offset,
  156. int length);
  157. /**
  158. * Writes an array of unsigned CORBA longs (i.e. Java ints) on this output stream.
  159. * @param value the array to be written.
  160. * @param offset offset on the stream.
  161. * @param length length of buffer to write.
  162. */
  163. public abstract void write_ulong_array(int[] value, int offset,
  164. int length);
  165. /**
  166. * Writes an array of CORBA longlongs (i.e. Java longs) on this output stream.
  167. * @param value the array to be written.
  168. * @param offset offset on the stream.
  169. * @param length length of buffer to write.
  170. */
  171. public abstract void write_longlong_array(long[] value, int offset,
  172. int length);
  173. /**
  174. * Writes an array of unsigned CORBA longlongs (i.e. Java ints) on this output stream.
  175. * @param value the array to be written.
  176. * @param offset offset on the stream.
  177. * @param length length of buffer to write.
  178. */
  179. public abstract void write_ulonglong_array(long[] value, int offset,
  180. int length);
  181. /**
  182. * Writes an array of floats on this output stream.
  183. * @param value the array to be written.
  184. * @param offset offset on the stream.
  185. * @param length length of buffer to write.
  186. */
  187. public abstract void write_float_array(float[] value, int offset,
  188. int length);
  189. /**
  190. * Writes an array of doubles on this output stream.
  191. * @param value the array to be written.
  192. * @param offset offset on the stream.
  193. * @param length length of buffer to write.
  194. */
  195. public abstract void write_double_array(double[] value, int offset,
  196. int length);
  197. /**
  198. * Writes a CORBA Object on this output stream.
  199. * @param value the value to be written.
  200. */
  201. public abstract void write_Object(org.omg.CORBA.Object value);
  202. /**
  203. * Writes a TypeCode on this output stream.
  204. * @param value the value to be written.
  205. */
  206. public abstract void write_TypeCode(TypeCode value);
  207. /**
  208. * Writes an Any on this output stream.
  209. * @param value the value to be written.
  210. */
  211. public abstract void write_any(Any value);
  212. /**
  213. * Writes a Principle on this output stream.
  214. * @param value the value to be written.
  215. * @deprecated Deprecated by CORBA 2.2.
  216. */
  217. public abstract void write_Principal(Principal value);
  218. /**
  219. * Writes an integer (length of arrays) onto this stream.
  220. * @param b the value to be written.
  221. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  222. * package comments for unimplemented features</a>
  223. */
  224. public void write(int b) throws java.io.IOException {
  225. throw new org.omg.CORBA.NO_IMPLEMENT();
  226. }
  227. /**
  228. * Writes a BigDecimal number.
  229. * @param value a BidDecimal--value to be written.
  230. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  231. * package comments for unimplemented features</a>
  232. */
  233. public void write_fixed(java.math.BigDecimal value) {
  234. throw new org.omg.CORBA.NO_IMPLEMENT();
  235. }
  236. /**
  237. * Writes a CORBA context on this stream. The
  238. * Context is marshaled as a sequence of strings.
  239. * Only those Context values specified in the contexts
  240. * parameter are actually written.
  241. * @param a CORBA context.
  242. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  243. * package comments for unimplemented features</a>
  244. */
  245. public void write_Context(org.omg.CORBA.Context ctx,
  246. org.omg.CORBA.ContextList contexts) {
  247. throw new org.omg.CORBA.NO_IMPLEMENT();
  248. }
  249. /**
  250. * Returns the ORB that created this OutputStream.
  251. * @return the ORB that created this OutputStream.
  252. * @see <a href="package-summary.html#unimpl"><code>portable</code>
  253. * package comments for unimplemented features</a>
  254. */
  255. public org.omg.CORBA.ORB orb() {
  256. throw new org.omg.CORBA.NO_IMPLEMENT();
  257. }
  258. }