source: trunk/gcc/libjava/java/io/DataOutput.java

Last change on this file was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 6.5 KB
Line 
1/* DataOutput.java -- Interface for writing data from a stream
2 Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package java.io;
40
41/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
42 * "The Java Language Specification", ISBN 0-201-63451-1
43 * Status: Complete to version 1.1.
44 */
45
46/**
47 * This interface is implemented by classes that can wrte data to streams
48 * from Java primitive types.
49 *
50 * @author Aaron M. Renn (arenn@urbanophile.com)
51 * @author Tom Tromey <tromey@cygnus.com>
52 */
53public interface DataOutput
54{
55
56/**
57 * This method writes a Java boolean value to an output stream
58 *
59 * @param value The boolean value to write
60 *
61 * @exception IOException If an error occurs
62 */
63void
64writeBoolean(boolean value) throws IOException;
65
66/*************************************************************************/
67
68/**
69 * This method writes a Java byte value to an output stream
70 *
71 * @param value The int value to write
72 *
73 * @exception IOException If an error occurs
74 */
75void
76writeByte(int value) throws IOException;
77
78/*************************************************************************/
79
80/**
81 * This method writes a Java char value to an output stream
82 *
83 * @param value The char value to write
84 *
85 * @exception IOException If an error occurs
86 */
87void
88writeChar(int value) throws IOException;
89
90/*************************************************************************/
91
92/**
93 * This method writes a Java int value to an output stream as a 16 bit value
94 *
95 * @param value The int value to write as a 16-bit value
96 *
97 * @exception IOException If an error occurs
98 */
99void
100writeShort(int value) throws IOException;
101
102/*************************************************************************/
103
104/**
105 * This method writes a Java int value to an output stream
106 *
107 * @param value The int value to write
108 *
109 * @exception IOException If an error occurs
110 */
111void
112writeInt(int value) throws IOException;
113
114/*************************************************************************/
115
116/**
117 * This method writes a Java long value to an output stream
118 *
119 * @param value The long value to write
120 *
121 * @exception IOException If an error occurs
122 */
123void
124writeLong(long value) throws IOException;
125
126/*************************************************************************/
127
128/**
129 * This method writes a Java float value to an output stream
130 *
131 * @param value The float value to write
132 *
133 * @exception IOException If an error occurs
134 */
135void
136writeFloat(float value) throws IOException;
137
138/*************************************************************************/
139
140/**
141 * This method writes a Java double value to an output stream
142 *
143 * @param value The double value to write
144 *
145 * @exception IOException If any other error occurs
146 */
147void
148writeDouble(double value) throws IOException;
149
150/*************************************************************************/
151
152/**
153 * This method writes a String to an output stream as an array of bytes
154 *
155 * @param value The String to write
156 *
157 * @exception IOException If an error occurs
158 */
159void
160writeBytes(String value) throws IOException;
161
162/*************************************************************************/
163
164/**
165 * This method writes a String to an output stream as an array of char's
166 *
167 * @param value The String to write
168 *
169 * @exception IOException If an error occurs
170 */
171void
172writeChars(String value) throws IOException;
173
174/*************************************************************************/
175
176/**
177 * This method writes a String to an output stream encoded in
178 * UTF-8 format.
179 *
180 * @param value The String to write
181 *
182 * @exception IOException If an error occurs
183 */
184void
185writeUTF(String value) throws IOException;
186
187/*************************************************************************/
188
189/**
190 * This method writes an 8-bit value (passed into the method as a Java
191 * int) to an output stream.
192 *
193 * @param value The byte to write to the output stream
194 *
195 * @exception IOException If an error occurs
196 */
197void
198write(int value) throws IOException;
199
200/*************************************************************************/
201
202/**
203 * This method writes the raw byte array passed in to the output stream.
204 *
205 * @param buf The byte array to write
206 *
207 * @exception IOException If an error occurs
208 */
209void
210write(byte[] buf) throws IOException;
211
212/*************************************************************************/
213
214/**
215 * This method writes raw bytes from the passed array <code>buf</code> starting
216 * <code>offset</code> bytes into the buffer. The number of bytes written will be
217 * exactly <code>len</code>.
218 *
219 * @param buf The buffer from which to write the data
220 * @param offset The offset into the buffer to start writing data from
221 * @param len The number of bytes to write from the buffer to the output stream
222 *
223 * @exception IOException If any other error occurs
224 */
225void
226write(byte[] buf, int offset, int len) throws IOException;
227
228} // interface DataOutput
Note: See TracBrowser for help on using the repository browser.