Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / javax / imageio / stream / ImageOutputStream.java
blobb00b37ff9b707b72d2cfc00c048003e47f099468
1 /* ImageOutputStream.java
2 Copyright (C) 2004, 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., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 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 javax.imageio.stream;
41 import java.io.DataOutput;
42 import java.io.IOException;
45 /**
46 * An output stream for use by {@link javax.imageio.ImageWriter
47 * ImageWriters}.
49 * @since 1.4
51 * @author Sascha Brawer (brawer@dandelis.ch)
53 public interface ImageOutputStream
54 extends ImageInputStream, DataOutput
56 /**
57 * @param postion
59 * @throws IOException if an errror occurs
61 void flushBefore(long position) throws IOException;
63 /**
64 * Writes an array into the stream.
66 * @param data the data to be written
68 * @throws IOException if an errror occurs
70 void write(byte[] data) throws IOException;
72 /**
73 * Writes a region of data from an array into the stream.
75 * @param data the data to be written
76 * @param offset the offset in the array
77 * @param len the length in the array
79 * @throws IOException if an errror occurs
81 void write(byte[] data, int offset, int len) throws IOException;
83 /**
84 * Writes an <code>int</code> into the stream.
86 * @param data the data to be written
88 * @throws IOException if an errror occurs
90 void write(int data) throws IOException;
92 /**
93 * Writes a bit value to the stream.
95 * @throws IOException if an error occurs
97 void writeBit(int bit) throws IOException;
99 /**
100 * Writes a number of bit values to the stream.
102 * @throws IOException if an errror occurs
104 void writeBits(long bits, int numBits) throws IOException;
107 * Writes a <code>boolean</code> value into the stream.
109 * @param data the data to be written
111 * @throws IOException if an errror occurs
113 void writeBoolean(boolean data) throws IOException;
116 * Writes a <code>byte</code> value into the stream.
118 * @param data the data to be written
120 * @throws IOException if an errror occurs
122 void writeByte(int data) throws IOException;
125 * @param data the data to be written
127 * @throws IOException if an errror occurs
129 void writeBytes(String data) throws IOException;
132 * Writes a character into the stream.
134 * @param data the data to be written
136 * @throws IOException if an errror occurs
138 void writeChar(int data) throws IOException;
141 * Writes characters to the stream.
143 * @param data the data to be written
144 * @param offset the offset in the array
145 * @param len the lenth in the array
147 * @throws IOException if an errror occurs
149 void writeChars(char[] data, int offset, int len) throws IOException;
152 * Writes characters from a given <code>String</code> into the stream.
154 * @param data the data to be written
156 * @throws IOException if an errror occurs
158 void writeChars(String data) throws IOException;
161 * Writes a <code>double</code> into the stream.
163 * @param data the data to be written
165 * @throws IOException if an errror occurs
167 void writeDouble(double data) throws IOException;
170 * Writes an array of <code>double</code> into the stream.
172 * @param data the data to be written
173 * @param offset the offset in the array
174 * @param len the lenth in the array
176 * @throws IOException if an errror occurs
178 void writeDoubles(double[] data, int offset, int len)
179 throws IOException;
182 * Writes a <code>float</code> into the stream.
184 * @param data the data to be written
186 * @throws IOException if an errror occurs
188 void writeFloat(float data) throws IOException;
191 * Writes an array of <code>float</code> into the stream.
193 * @param data the data to be written
194 * @param offset the offset in the array
195 * @param len the lenth in the array
197 * @throws IOException if an errror occurs
199 void writeFloats(float[] data, int offset, int len) throws IOException;
202 * Writes a <code>int</code> into the stream.
204 * @param data the data to be written
206 * @throws IOException if an errror occurs
208 void writeInt(int data) throws IOException;
211 * Writes an array of <code>int</code> into the stream.
213 * @param data the data to be written
214 * @param offset the offset in the array
215 * @param len the lenth in the array
217 * @throws IOException if an errror occurs
219 void writeInts(int[] data, int offset, int len) throws IOException;
222 * Writes a <code>long</code> into the stream.
224 * @param data the data to be written
226 * @throws IOException if an errror occurs
228 void writeLong(long data) throws IOException;
231 * Writes an array of <code>long</code> into the stream.
233 * @param data the data to be written
234 * @param offset the offset in the array
235 * @param len the lenth in the array
237 * @throws IOException if an errror occurs
239 void writeLongs(long[] data, int offset, int len) throws IOException;
242 * Writes a <code>short</code> into the stream.
244 * @param data the data to be written
246 * @throws IOException if an errror occurs
248 void writeShort(int data) throws IOException;
251 * Writes an array of <code>short</code> into the stream.
253 * @param data the data to be written
254 * @param offset the offset in the array
255 * @param len the lenth in the array
257 * @throws IOException if an errror occurs
259 void writeShorts(short[] data, int offset, int len) throws IOException;
262 * Writes a <code>String</code> into the stream.
264 * @param data the data to be written
266 * @throws IOException if an errror occurs
268 void writeUTF(String data) throws IOException;