@@ -65,44 +65,61 @@ public interface VariableByteInput {
6565 * Read a single byte and return as an int value.
6666 *
6767 * @return the byte value as int or -1 if no more bytes are available.
68- * @throws IOException in case of an I/O error
68+ *
69+ * @throws IOException in case of an I/O error.
6970 */
7071 int read () throws IOException ;
7172
7273 /**
7374 * Fill the provided byte array with data from the input.
7475 *
75- * @param data the buffer to read
76+ * @param data the buffer to write data to.
77+ *
78+ * @return the number of bytes written to the buffer.
79+ *
7680 * @throws IOException in case of an I/O error
77- * @return the number of bytes read
7881 */
7982 int read (byte [] data ) throws IOException ;
80-
81- int read (byte b [], int off , int len ) throws IOException ;
83+
84+ /**
85+ * Fill the provided byte array with data from the input.
86+ *
87+ * @param data the buffer to write data to.
88+ * @param off the offset in the buffer to start writing at.
89+ * @param len the maximum number of bytes to write into the buffer.
90+ *
91+ * @return the number of bytes written to the buffer.
92+ *
93+ * @throws IOException in case of an I/O error.
94+ */
95+ int read (byte data [], int off , int len ) throws IOException ;
8296
8397 /**
8498 * Returns a value > 0 if more bytes can be read
8599 * from the input.
86100 *
87- * @throws IOException in case of an I/O error
88- * @return the number of bytes available
101+ * @return the number of bytes available.
102+ *
103+ * @throws IOException in case of an I/O error.
89104 */
90105 int available () throws IOException ;
91106
92107 /**
93108 * Read a single byte. Throws EOFException if no
94109 * more bytes are available.
95110 *
96- * @throws IOException in case of an I/O error
97- * @return the byte read
111+ * @return the byte read.
112+ *
113+ * @throws IOException in case of an I/O error.
98114 */
99115 byte readByte () throws IOException ;
100116
101117 /**
102118 * Read a short value in variable byte encoding.
103119 *
104- * @throws IOException in case of an I/O error
105- * @return the short read
120+ * @return the short read.
121+ *
122+ * @throws IOException in case of an I/O error.
106123 */
107124 short readShort () throws IOException ;
108125
@@ -112,14 +129,17 @@ public interface VariableByteInput {
112129 * Requires 2 bytes.
113130 *
114131 * @return the short.
132+ *
133+ * @throws IOException in case of an I/O error.
115134 */
116135 short readFixedShort () throws IOException ;
117136
118137 /**
119138 * Read an integer value in variable byte encoding.
120139 *
121- * @throws IOException in case of an I/O error
122- * @return the int read
140+ * @return the int read.
141+ *
142+ * @throws IOException in case of an I/O error.
123143 */
124144 int readInt () throws IOException ;
125145
@@ -129,14 +149,17 @@ public interface VariableByteInput {
129149 * Requires 4 bytes.
130150 *
131151 * @return the int.
152+ *
153+ * @throws IOException in case of an I/O error.
132154 */
133155 int readFixedInt () throws IOException ;
134156
135157 /**
136158 * Read a long value in variable byte encoding.
137159 *
138- * @throws IOException in case of an I/O error
139- * @return the long read
160+ * @return the long read.
161+ *
162+ * @throws IOException in case of an I/O error.
140163 */
141164 long readLong () throws IOException ;
142165
@@ -146,83 +169,104 @@ public interface VariableByteInput {
146169 * Requires 8 bytes.
147170 *
148171 * @return the long.
172+ *
173+ * @throws IOException in case of an I/O error.
149174 */
150175 long readFixedLong () throws IOException ;
151176
152177 /**
153178 * Read a big integer in variable byte encoding.
154179 *
155- * @throws IOException in case of an I/O error
180+ * @return the big integer read.
156181 *
157- * @return the big integer read
182+ * @throws IOException in case of an I/O error.
158183 */
159184 BigInteger readBigInteger () throws IOException ;
160185
161186 /**
162187 * Read a fixed size big integer from input.
163188 *
164- * @throws IOException in case of an I/O error
189+ * @return the big integer read.
165190 *
166- * @return the big integer read
191+ * @throws IOException in case of an I/O error.
167192 */
168193 BigInteger readFixedBigInteger () throws IOException ;
169194
170195 /**
171196 * Read a big decimal in variable byte encoding.
172197 *
173- * @throws IOException in case of an I/O error
198+ * @return the big decimal read.
174199 *
175- * @return the big decimal read
200+ * @throws IOException in case of an I/O error.
176201 */
177202 BigDecimal readBigDecimal () throws IOException ;
178203
179204 /**
180205 * Read a fixed size big decimal from input.
181206 *
182- * @throws IOException in case of an I/O error
207+ * @return the big decimal read.
183208 *
184- * @return the big decimal read
209+ * @throws IOException in case of an I/O error.
185210 */
186211 BigDecimal readFixedBigDecimal () throws IOException ;
187212
188213 /**
189214 * Read a string as UTF-8 encoded bytes from the input.
190215 *
191216 * @return the string.
217+ *
218+ * @throws IOException in case of an I/O error.
192219 */
193220 String readUTF () throws IOException ;
194221
195222 /**
196- * Read the following count numeric values from the input
197- * and drop them.
223+ * Skip over a number of numeric values from.
198224 *
199- * @param count the number of bytes to skip
200- * @throws IOException in case of an I/O error
225+ * @param count the number of numeric values to skip.
226+ *
227+ * @throws IOException in case of an I/O error.
201228 */
202229 void skip (int count ) throws IOException ;
203230
231+ /**
232+ * Skip over a number of bytes.
233+ *
234+ * @param count the number of bytes to skip.
235+ *
236+ * @throws IOException in case of an I/O error.
237+ */
204238 void skipBytes (long count ) throws IOException ;
205239
206240 /**
207241 * Copy the next numeric value from the input to the
208242 * specified output stream.
209243 *
210- * @param output the output destination to copy the data to
211- * @throws IOException in case of an I/O error
244+ * @param output the output destination to copy the data to.
245+ *
246+ * @throws IOException in case of an I/O error.
212247 */
213248 void copyTo (VariableByteOutput output ) throws IOException ;
214249
215250 /**
216251 * Copy the count next numeric values from the input to
217252 * the specified output stream.
218253 *
219- * @param os the output destination to copy the data to
220- * @param count the number of bytes to copy
221- * @throws IOException in case of an I/O error
254+ * @param os the output destination to copy the data to.
255+ * @param count the number of bytes to copy.
256+ *
257+ * @throws IOException in case of an I/O error.
222258 */
223259 void copyTo (VariableByteOutput os , int count )
224260 throws IOException ;
225-
261+
262+ /**
263+ * Copy bytes from the input to the specified output stream.
264+ *
265+ * @param os the output destination to copy the data to.
266+ * @param bytes the number of bytes to copy.
267+ *
268+ * @throws IOException in case of an I/O error.
269+ */
226270 void copyRaw (VariableByteOutput os , int bytes )
227271 throws IOException ;
228272}
0 commit comments