1 /* AbstractDataOutput.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)
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
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
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 gnu.CORBA.CDR;
41 import java.io.IOException;
44 * An abstract data output stream that could write data in either
45 * Big Endian or Little Endian format.
47 * This class reuses code from GNU Classpath DataOutputStream.
49 * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
50 * @author Warren Levy (warrenl@cygnus.com)
51 * @author Aaron M. Renn (arenn@urbanophile.com)
53 public interface AbstractDataOutput
56 * This method flushes any unwritten bytes to the underlying stream.
58 * @exception IOException If an error occurs.
64 * This method writes the specified byte (passed as an <code>int</code>)
65 * to the underlying output stream.
67 * @param value The <code>byte</code> to write, passed as an <code>int</code>.
69 * @exception IOException If an error occurs.
75 * This method writes <code>len</code> bytes from the specified byte array
76 * <code>buf</code> starting at position <code>offset</code> into the
77 * buffer to the underlying output stream.
79 * @param buf The byte array to write from.
80 * @param offset The index into the byte array to start writing from.
81 * @param len The number of bytes to write.
83 * @exception IOException If an error occurs.
85 void write(byte[] buf, int offset, int len)
89 * Write the complete byte array.
92 void write(byte[] buf)
96 * This method writes a Java boolean value to an output stream. If
97 * <code>value</code> is <code>true</code>, a byte with the value of
98 * 1 will be written, otherwise a byte with the value of 0 will be
101 * The value written can be read using the <code>readBoolean</code>
102 * method in <code>DataInput</code>.
104 * @param value The <code>boolean</code> value to write to the stream
106 * @exception IOException If an error occurs
108 void writeBoolean(boolean value)
112 * This method writes a Java byte value to an output stream. The
113 * byte to be written will be in the lowest 8 bits of the
114 * <code>int</code> value passed.
116 * The value written can be read using the <code>readByte</code> or
117 * <code>readUnsignedByte</code> methods in <code>DataInput</code>.
119 * @param value The <code>byte</code> to write to the stream, passed as
120 * the low eight bits of an <code>int</code>.
122 * @exception IOException If an error occurs
124 void writeByte(int value)
128 * This method writes a Java short value to an output stream. The
129 * char to be written will be in the lowest 16 bits of the <code>int</code>
132 * @exception IOException If an error occurs
134 void writeShort(int value)
138 * This method writes a Java char value to an output stream. The
139 * char to be written will be in the lowest 16 bits of the <code>int</code>
142 * @exception IOException If an error occurs
144 void writeChar(int value)
148 * This method writes a Java int value to an output stream.
150 * @param value The <code>int</code> value to write to the stream
152 * @exception IOException If an error occurs
154 void writeInt(int value)
158 * This method writes a Java long value to an output stream.
160 * @param value The <code>long</code> value to write to the stream
162 * @exception IOException If an error occurs
164 void writeLong(long value)
168 * This method writes a Java <code>float</code> value to the stream.
169 * @param value The <code>float</code> value to write to the stream
171 * @exception IOException If an error occurs
173 void writeFloat(float value)
177 * This method writes a Java <code>double</code> value to the stream.
179 * @param value The <code>double</code> value to write to the stream
181 * @exception IOException If an error occurs
183 void writeDouble(double value)