corrade-vassal – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | vero | 1 | /* |
2 | * CVS Identifier: |
||
3 | * |
||
4 | * $Id: BinaryDataInput.java,v 1.12 2001/07/23 09:27:26 grosbois Exp $ |
||
5 | * |
||
6 | * Interface: BinaryDataInput |
||
7 | * |
||
8 | * Description: Stream like interface for binary |
||
9 | * input from a stream or file. |
||
10 | * |
||
11 | * |
||
12 | * |
||
13 | * COPYRIGHT: |
||
14 | * |
||
15 | * This software module was originally developed by Raphaël Grosbois and |
||
16 | * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel |
||
17 | * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David |
||
18 | * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research |
||
19 | * Centre France S.A) in the course of development of the JPEG2000 |
||
20 | * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This |
||
21 | * software module is an implementation of a part of the JPEG 2000 |
||
22 | * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio |
||
23 | * Systems AB and Canon Research Centre France S.A (collectively JJ2000 |
||
24 | * Partners) agree not to assert against ISO/IEC and users of the JPEG |
||
25 | * 2000 Standard (Users) any of their rights under the copyright, not |
||
26 | * including other intellectual property rights, for this software module |
||
27 | * with respect to the usage by ISO/IEC and Users of this software module |
||
28 | * or modifications thereof for use in hardware or software products |
||
29 | * claiming conformance to the JPEG 2000 Standard. Those intending to use |
||
30 | * this software module in hardware or software products are advised that |
||
31 | * their use may infringe existing patents. The original developers of |
||
32 | * this software module, JJ2000 Partners and ISO/IEC assume no liability |
||
33 | * for use of this software module or modifications thereof. No license |
||
34 | * or right to this software module is granted for non JPEG 2000 Standard |
||
35 | * conforming products. JJ2000 Partners have full right to use this |
||
36 | * software module for his/her own purpose, assign or donate this |
||
37 | * software module to any third party and to inhibit third parties from |
||
38 | * using this software module for non JPEG 2000 Standard conforming |
||
39 | * products. This copyright notice must be included in all copies or |
||
40 | * derivative works of this software module. |
||
41 | * |
||
42 | * Copyright (c) 1999/2000 JJ2000 Partners. |
||
43 | * */ |
||
44 | using System; |
||
45 | namespace CSJ2K.j2k.io |
||
46 | { |
||
47 | |||
48 | /// <summary> This interface defines the input of binary data from streams and/or files. |
||
49 | /// |
||
50 | /// <p>Byte level input (i.e., for byte, int, long, float, etc.) should always |
||
51 | /// be byte aligned. For example, a request to read an <tt>int</tt> should |
||
52 | /// always realign the input at the byte level.</p> |
||
53 | /// |
||
54 | /// <p>The implementation of this interface should clearly define if multi-byte |
||
55 | /// input data is read in little- or big-endian byte ordering (least |
||
56 | /// significant byte first or most significant byte first, respectively).</p> |
||
57 | /// |
||
58 | /// </summary> |
||
59 | /// <seealso cref="EndianType"> |
||
60 | /// |
||
61 | /// </seealso> |
||
62 | public interface BinaryDataInput |
||
63 | { |
||
64 | /// <summary> Returns the endianess (i.e., byte ordering) of the implementing |
||
65 | /// class. Note that an implementing class may implement only one type of |
||
66 | /// endianness or both, which would be decided at creatiuon time. |
||
67 | /// |
||
68 | /// </summary> |
||
69 | /// <returns> Either <tt>EndianType.BIG_ENDIAN</tt> or |
||
70 | /// <tt>EndianType.LITTLE_ENDIAN</tt> |
||
71 | /// |
||
72 | /// </returns> |
||
73 | /// <seealso cref="EndianType"> |
||
74 | /// |
||
75 | /// </seealso> |
||
76 | int ByteOrdering |
||
77 | { |
||
78 | get; |
||
79 | |||
80 | } |
||
81 | |||
82 | /// <summary> Should read a signed byte (i.e., 8 bit) from the input. reading, the |
||
83 | /// input should be realigned at the byte level. |
||
84 | /// |
||
85 | /// </summary> |
||
86 | /// <returns> The next byte-aligned signed byte (8 bit) from the input. |
||
87 | /// |
||
88 | /// </returns> |
||
89 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
90 | /// all the necessary data. |
||
91 | /// |
||
92 | /// </exception> |
||
93 | /// <exception cref="IOException">If an I/O error ocurred. |
||
94 | /// |
||
95 | /// </exception> |
||
96 | byte readByte(); |
||
97 | |||
98 | /// <summary> Should read an unsigned byte (i.e., 8 bit) from the input. It is |
||
99 | /// returned as an <tt>int</tt> since Java does not have an unsigned byte |
||
100 | /// type. Prior to reading, the input should be realigned at the byte |
||
101 | /// level. |
||
102 | /// |
||
103 | /// </summary> |
||
104 | /// <returns> The next byte-aligned unsigned byte (8 bit) from the input, as |
||
105 | /// an <tt>int</tt>. |
||
106 | /// |
||
107 | /// </returns> |
||
108 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
109 | /// all the necessary data. |
||
110 | /// |
||
111 | /// </exception> |
||
112 | /// <exception cref="IOException">If an I/O error ocurred. |
||
113 | /// |
||
114 | /// </exception> |
||
115 | byte readUnsignedByte(); |
||
116 | |||
117 | /// <summary> Should read a signed short (i.e., 16 bit) from the input. Prior to |
||
118 | /// reading, the input should be realigned at the byte level. |
||
119 | /// |
||
120 | /// </summary> |
||
121 | /// <returns> The next byte-aligned signed short (16 bit) from the input. |
||
122 | /// |
||
123 | /// </returns> |
||
124 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
125 | /// all the necessary data. |
||
126 | /// |
||
127 | /// </exception> |
||
128 | /// <exception cref="IOException">If an I/O error ocurred. |
||
129 | /// |
||
130 | /// </exception> |
||
131 | short readShort(); |
||
132 | |||
133 | /// <summary> Should read an unsigned short (i.e., 16 bit) from the input. It is |
||
134 | /// returned as an <tt>int</tt> since Java does not have an unsigned short |
||
135 | /// type. Prior to reading, the input should be realigned at the byte |
||
136 | /// level. |
||
137 | /// |
||
138 | /// </summary> |
||
139 | /// <returns> The next byte-aligned unsigned short (16 bit) from the input, |
||
140 | /// as an <tt>int</tt>. |
||
141 | /// |
||
142 | /// </returns> |
||
143 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
144 | /// all the necessary data. |
||
145 | /// |
||
146 | /// </exception> |
||
147 | /// <exception cref="IOException">If an I/O error ocurred. |
||
148 | /// |
||
149 | /// </exception> |
||
150 | int readUnsignedShort(); |
||
151 | |||
152 | /// <summary> Should read a signed int (i.e., 32 bit) from the input. Prior to |
||
153 | /// reading, the input should be realigned at the byte level. |
||
154 | /// |
||
155 | /// </summary> |
||
156 | /// <returns> The next byte-aligned signed int (32 bit) from the input. |
||
157 | /// |
||
158 | /// </returns> |
||
159 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
160 | /// all the necessary data. |
||
161 | /// |
||
162 | /// </exception> |
||
163 | /// <exception cref="IOException">If an I/O error ocurred. |
||
164 | /// |
||
165 | /// </exception> |
||
166 | int readInt(); |
||
167 | |||
168 | /// <summary> Should read an unsigned int (i.e., 32 bit) from the input. It is |
||
169 | /// returned as a <tt>long</tt> since Java does not have an unsigned short |
||
170 | /// type. Prior to reading, the input should be realigned at the byte |
||
171 | /// level. |
||
172 | /// |
||
173 | /// </summary> |
||
174 | /// <returns> The next byte-aligned unsigned int (32 bit) from the input, as |
||
175 | /// a <tt>long</tt>. |
||
176 | /// |
||
177 | /// </returns> |
||
178 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
179 | /// all the necessary data. |
||
180 | /// |
||
181 | /// </exception> |
||
182 | /// <exception cref="IOException">If an I/O error ocurred. |
||
183 | /// |
||
184 | /// </exception> |
||
185 | long readUnsignedInt(); |
||
186 | |||
187 | /// <summary> Should read a signed long (i.e., 64 bit) from the input. Prior to |
||
188 | /// reading, the input should be realigned at the byte level. |
||
189 | /// |
||
190 | /// </summary> |
||
191 | /// <returns> The next byte-aligned signed long (64 bit) from the input. |
||
192 | /// |
||
193 | /// </returns> |
||
194 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
195 | /// all the necessary data. |
||
196 | /// |
||
197 | /// </exception> |
||
198 | /// <exception cref="IOException">If an I/O error ocurred. |
||
199 | /// |
||
200 | /// </exception> |
||
201 | long readLong(); |
||
202 | |||
203 | /// <summary> Should read an IEEE single precision (i.e., 32 bit) floating-point |
||
204 | /// number from the input. Prior to reading, the input should be realigned |
||
205 | /// at the byte level. |
||
206 | /// |
||
207 | /// </summary> |
||
208 | /// <returns> The next byte-aligned IEEE float (32 bit) from the input. |
||
209 | /// |
||
210 | /// </returns> |
||
211 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
212 | /// all the necessary data. |
||
213 | /// |
||
214 | /// </exception> |
||
215 | /// <exception cref="IOException">If an I/O error ocurred. |
||
216 | /// |
||
217 | /// </exception> |
||
218 | float readFloat(); |
||
219 | |||
220 | /// <summary> Should read an IEEE double precision (i.e., 64 bit) floating-point |
||
221 | /// number from the input. Prior to reading, the input should be realigned |
||
222 | /// at the byte level. |
||
223 | /// |
||
224 | /// </summary> |
||
225 | /// <returns> The next byte-aligned IEEE double (64 bit) from the input. |
||
226 | /// |
||
227 | /// </returns> |
||
228 | /// <exception cref="EOFException">If the end-of file was reached before getting |
||
229 | /// all the necessary data. |
||
230 | /// |
||
231 | /// </exception> |
||
232 | /// <exception cref="IOException">If an I/O error ocurred. |
||
233 | /// |
||
234 | /// </exception> |
||
235 | double readDouble(); |
||
236 | |||
237 | /// <summary> Skips <tt>n</tt> bytes from the input. Prior to skipping, the input |
||
238 | /// should be realigned at the byte level. |
||
239 | /// |
||
240 | /// </summary> |
||
241 | /// <param name="n">The number of bytes to skip |
||
242 | /// |
||
243 | /// </param> |
||
244 | /// <exception cref="EOFException">If the end-of file was reached before all the |
||
245 | /// bytes could be skipped. |
||
246 | /// |
||
247 | /// </exception> |
||
248 | /// <exception cref="IOException">If an I/O error ocurred. |
||
249 | /// |
||
250 | /// </exception> |
||
251 | int skipBytes(int n); |
||
252 | } |
||
253 | } |