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