corrade-vassal – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 vero 1 /*
2 * CVS Identifier:
3 *
4 * $Id: RandomAccessIO.java,v 1.15 2001/10/24 12:07:02 grosbois Exp $
5 *
6 * Interface: RandomAccessIO.java
7 *
8 * Description: Interface definition for random access I/O.
9 *
10 *
11 *
12 * COPYRIGHT:
13 *
14 * This software module was originally developed by Raphaël Grosbois and
15 * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
16 * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David
17 * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research
18 * Centre France S.A) in the course of development of the JPEG2000
19 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
20 * software module is an implementation of a part of the JPEG 2000
21 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
22 * Systems AB and Canon Research Centre France S.A (collectively JJ2000
23 * Partners) agree not to assert against ISO/IEC and users of the JPEG
24 * 2000 Standard (Users) any of their rights under the copyright, not
25 * including other intellectual property rights, for this software module
26 * with respect to the usage by ISO/IEC and Users of this software module
27 * or modifications thereof for use in hardware or software products
28 * claiming conformance to the JPEG 2000 Standard. Those intending to use
29 * this software module in hardware or software products are advised that
30 * their use may infringe existing patents. The original developers of
31 * this software module, JJ2000 Partners and ISO/IEC assume no liability
32 * for use of this software module or modifications thereof. No license
33 * or right to this software module is granted for non JPEG 2000 Standard
34 * conforming products. JJ2000 Partners have full right to use this
35 * software module for his/her own purpose, assign or donate this
36 * software module to any third party and to inhibit third parties from
37 * using this software module for non JPEG 2000 Standard conforming
38 * products. This copyright notice must be included in all copies or
39 * derivative works of this software module.
40 *
41 * Copyright (c) 1999/2000 JJ2000 Partners.
42 * */
43 using System;
44 namespace CSJ2K.j2k.io
45 {
46  
47 /// <summary> This abstract class defines the interface to perform random access I/O. It
48 /// implements the <tt>BinaryDataInput</tt> and <tt>BinaryDataOutput</tt>
49 /// interfaces so that binary data input/output can be performed.
50 ///
51 /// <p>This interface supports streams of up to 2 GB in length.</p>
52 ///
53 /// </summary>
54 /// <seealso cref="BinaryDataInput">
55 /// </seealso>
56 /// <seealso cref="BinaryDataOutput">
57 ///
58 /// </seealso>
59 public interface RandomAccessIO:BinaryDataInput, BinaryDataOutput
60 {
61 /// <summary> Returns the current position in the stream, which is the position from
62 /// where the next byte of data would be read. The first byte in the stream
63 /// is in position <tt>0</tt>.
64 ///
65 /// </summary>
66 /// <returns> The offset of the current position, in bytes.
67 ///
68 /// </returns>
69 /// <exception cref="IOException">If an I/O error ocurred.
70 ///
71 /// </exception>
72 int Pos
73 {
74 get;
75  
76 }
77  
78 /// <summary> Closes the I/O stream. Prior to closing the stream, any buffered data
79 /// (at the bit and byte level) should be written.
80 ///
81 /// </summary>
82 /// <exception cref="IOException">If an I/O error ocurred.
83 ///
84 /// </exception>
85 void close();
86  
87 /// <summary> Returns the current length of the stream, in bytes, taking into account
88 /// any buffering.
89 ///
90 /// </summary>
91 /// <returns> The length of the stream, in bytes.
92 ///
93 /// </returns>
94 /// <exception cref="IOException">If an I/O error ocurred.
95 ///
96 /// </exception>
97 int length();
98  
99 /// <summary> Moves the current position for the next read or write operation to
100 /// offset. The offset is measured from the beginning of the stream. The
101 /// offset may be set beyond the end of the file, if in write mode. Setting
102 /// the offset beyond the end of the file does not change the file
103 /// length. The file length will change only by writing after the offset
104 /// has been set beyond the end of the file.
105 ///
106 /// </summary>
107 /// <param name="off">The offset where to move to.
108 ///
109 /// </param>
110 /// <exception cref="EOFException">If in read-only and seeking beyond EOF.
111 ///
112 /// </exception>
113 /// <exception cref="IOException">If an I/O error ocurred.
114 ///
115 /// </exception>
116 void seek(int off);
117  
118 /// <summary> Reads a byte of data from the stream. Prior to reading, the stream is
119 /// realigned at the byte level.
120 ///
121 /// </summary>
122 /// <returns> The byte read, as an int.
123 ///
124 /// </returns>
125 /// <exception cref="EOFException">If the end-of file was reached.
126 ///
127 /// </exception>
128 /// <exception cref="IOException">If an I/O error ocurred.
129 ///
130 /// </exception>
131 byte read();
132  
133 /// <summary> Reads up to len bytes of data from this file into an array of
134 /// bytes. This method reads repeatedly from the stream until all the bytes
135 /// are read. This method blocks until all the bytes are read, the end of
136 /// the stream is detected, or an exception is thrown.
137 ///
138 /// </summary>
139 /// <param name="b">The buffer into which the data is to be read. It must be long
140 /// enough.
141 ///
142 /// </param>
143 /// <param name="off">The index in 'b' where to place the first byte read.
144 ///
145 /// </param>
146 /// <param name="len">The number of bytes to read.
147 ///
148 /// </param>
149 /// <exception cref="EOFException">If the end-of file was reached before
150 /// getting all the necessary data.
151 ///
152 /// </exception>
153 /// <exception cref="IOException">If an I/O error ocurred.
154 ///
155 /// </exception>
156 void readFully(byte[] b, int off, int len);
157  
158 /// <summary> Writes a byte to the stream. Prior to writing, the stream is realigned
159 /// at the byte level.
160 ///
161 /// </summary>
162 /// <param name="b">The byte to write. The lower 8 bits of <tt>b</tt> are
163 /// written.
164 ///
165 /// </param>
166 /// <exception cref="IOException">If an I/O error ocurred.
167 ///
168 /// </exception>
169 void write(byte b);
170 }
171 }