Imported GNU Classpath 0.90
[official-gcc.git] / libjava / classpath / org / omg / CORBA / portable / OutputStream.java
blobf40be23656fea8c4dd1ed75ae5f28cf4adeae8cd
1 /* OutputStream.java --
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package org.omg.CORBA.portable;
41 import org.omg.CORBA.Any;
42 import org.omg.CORBA.Context;
43 import org.omg.CORBA.ContextList;
44 import org.omg.CORBA.NO_IMPLEMENT;
45 import org.omg.CORBA.ORB;
46 import org.omg.CORBA.Principal;
47 import org.omg.CORBA.TypeCode;
49 import java.io.IOException;
51 import java.math.BigDecimal;
53 /**
54 * This class is used to write CORBA IDL data types.
56 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
58 public abstract class OutputStream
59 extends java.io.OutputStream
61 /**
62 * Returns an input stream with the same buffer.
63 * @return an input stream
65 public abstract InputStream create_input_stream();
67 /**
68 * Return the Object Request Broker that has created this stream.
69 * @return the ORB. This must be overridden, as the default
70 * method always returns null.
72 public ORB orb()
74 return null;
77 /**
78 * Should write an byte (lower 8 bits) to the output stream, but,
79 * following specification, it does not and
80 * must be overridden to get a functionality.
82 * @param n an integer to write.
84 * @throws NO_IMPLEMENT, always.
85 * @throws IOException in overriden methods.
87 public void write(int n)
88 throws IOException
90 throw new NO_IMPLEMENT();
93 /**
94 * Should write a CORBA context to the output stream, but,
95 * following the 1.4 specification, it does not and
96 * must be overridden to get a functionality.
98 * @throws NO_IMPLEMENT, always.
100 public void write_Context(Context context, ContextList contexts)
102 throw new NO_IMPLEMENT();
106 * Write CORBA (not java) Object.
108 public abstract void write_Object(org.omg.CORBA.Object x);
111 * Should write a principal to the output stream, but,
112 * following specification, it does not and
113 * must be overridden to get a functionality.
115 * @deprecated by CORBA 2.2
117 * @param principal a Principal to write
119 * @throws NO_IMPLEMENT, always.
121 public void write_Principal(Principal principal)
123 throw new NO_IMPLEMENT();
127 * Write TypeCode.
129 public abstract void write_TypeCode(TypeCode x);
132 * Write CORBA <code>Any</code>.
134 public abstract void write_any(Any x);
137 * Write CORBA <code>boolean</code>.
139 public abstract void write_boolean(boolean x);
142 * Write CORBA <code>booelan[]</code>.
144 public abstract void write_boolean_array(boolean[] x, int ofs, int len);
147 * Write CORBA <code>char</code>.
149 public abstract void write_char(char x);
152 * Write CORBA <code>char[]</code>.
154 public abstract void write_char_array(char[] chars, int offset, int length);
157 * Write CORBA <code>double</code>.
159 public abstract void write_double(double x);
162 * Write CORBA <code>double[]</code>.
164 public abstract void write_double_array(double[] x, int ofs, int len);
167 * Should write a BigDecimal number, but, following specification,
168 * it does not and must be overridden to get a functionality.
170 * @param fixed a number to write
171 * @throws NO_IMPLEMENT, always.
173 public void write_fixed(BigDecimal fixed)
175 throw new NO_IMPLEMENT();
179 * Write CORBA <code>float</code>.
181 public abstract void write_float(float x);
184 * Write CORBA <code>float[]</code>.
186 public abstract void write_float_array(float[] x, int ofs, int len);
189 * Write CORBA <code>long</code> that is mapped into java <code>int</code>.
191 public abstract void write_long(int x);
194 * Write CORBA <code>long[]</code>.
196 public abstract void write_long_array(int[] x, int ofs, int len);
199 * Write CORBA <code>long long</code> that is mapped into
200 * java <code>long</code>.
202 public abstract void write_longlong(long x);
205 * Write CORBA <code>long long []</code>.
207 public abstract void write_longlong_array(long[] x, int ofs, int len);
210 * Write CORBA <code>octed</code> that is mapped into java <code>byte</code>
212 public abstract void write_octet(byte x);
215 * Write CORBA <code>octet[]</code>.
217 public abstract void write_octet_array(byte[] x, int ofs, int len);
220 * Write CORBA <code>short</code>.
222 public abstract void write_short(short x);
225 * Write CORBA <code>short[]</code>.
227 public abstract void write_short_array(short[] x, int ofs, int len);
230 * Write CORBA <code>string</code>.
232 public abstract void write_string(String x);
235 * Write unsigned CORBA <code>long</code> that is mapped into
236 * java <code>int</code>.
238 public abstract void write_ulong(int x);
241 * Write array of CORBA unsigned longs.
243 public abstract void write_ulong_array(int[] x, int ofs, int len);
246 * Write unsigned CORBA <code>long long </code> that is mapped into
247 * java <code>long</code>.
249 public abstract void write_ulonglong(long x);
252 * Write array of unsigned CORBA long-longs.
254 public abstract void write_ulonglong_array(long[] x, int ofs, int len);
257 * Write unsigned CORBA <code>short</code> that is mapped into
258 * java <code>short</code>.
260 public abstract void write_ushort(short x);
263 * Write array of unsigned CORBA shorts.
265 public abstract void write_ushort_array(short[] x, int ofs, int len);
268 * Write CORBA <code>wchar</code> that is mapped into
269 * java <code>char</code>.
271 public abstract void write_wchar(char x);
274 * Write array of CORBA wchars.
276 public abstract void write_wchar_array(char[] chars, int offset, int length);
279 * Write CORBA <code>wstring</code> that is mapped into
280 * java <code>string</code>.
282 public abstract void write_wstring(String x);