OSDN Git Service

Modify its project name.
[nxt-jsp/etrobo-atk.git] / nxtOSEK / lejos_nxj / docs / apidocs / java / io / DataInputStream.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.5.0_09) on Tue Mar 27 00:00:26 BST 2007 -->
6 <TITLE>
7 DataInputStream (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="java.io.DataInputStream class">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17     parent.document.title="DataInputStream (leJOS NXT API documentation)";
18 }
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
22
23 </HEAD>
24
25 <BODY BGCOLOR="white" onload="windowTitle();">
26
27
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36   <TR ALIGN="center" VALIGN="top">
37   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44   </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
51
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;PREV CLASS&nbsp;
55 &nbsp;<A HREF="../../java/io/DataOutputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57   <A HREF="../../index.html?java/io/DataInputStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58 &nbsp;<A HREF="DataInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60   <!--
61   if(window==top) {
62     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
63   }
64   //-->
65 </SCRIPT>
66 <NOSCRIPT>
67   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
69
70
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
82
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 java.io</FONT>
88 <BR>
89 Class DataInputStream</H2>
90 <PRE>
91 <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
92   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../java/io/InputStream.html" title="class in java.io">java.io.InputStream</A>
93       <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>java.io.DataInputStream</B>
94 </PRE>
95 <HR>
96 <DL>
97 <DT><PRE>public class <B>DataInputStream</B><DT>extends <A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></DL>
98 </PRE>
99
100 <P>
101 <HR>
102
103 <P>
104 <!-- =========== FIELD SUMMARY =========== -->
105
106 <A NAME="field_summary"><!-- --></A>
107 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
108 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
109 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
110 <B>Field Summary</B></FONT></TH>
111 </TR>
112 <TR BGCOLOR="white" CLASS="TableRowColor">
113 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
114 <CODE>protected &nbsp;<A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></FONT></TD>
115 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#in">in</A></B></CODE>
116
117 <BR>
118 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
119 </TR>
120 </TABLE>
121 &nbsp;
122 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
123
124 <A NAME="constructor_summary"><!-- --></A>
125 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
126 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
127 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
128 <B>Constructor Summary</B></FONT></TH>
129 </TR>
130 <TR BGCOLOR="white" CLASS="TableRowColor">
131 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#DataInputStream(java.io.InputStream)">DataInputStream</A></B>(<A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A>&nbsp;in)</CODE>
132
133 <BR>
134 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
135 </TR>
136 </TABLE>
137 &nbsp;
138 <!-- ========== METHOD SUMMARY =========== -->
139
140 <A NAME="method_summary"><!-- --></A>
141 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
142 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
143 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
144 <B>Method Summary</B></FONT></TH>
145 </TR>
146 <TR BGCOLOR="white" CLASS="TableRowColor">
147 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
148 <CODE>&nbsp;int</CODE></FONT></TD>
149 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#read()">read</A></B>()</CODE>
150
151 <BR>
152 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads the next byte of data from this input stream.</TD>
153 </TR>
154 <TR BGCOLOR="white" CLASS="TableRowColor">
155 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
156 <CODE>&nbsp;int</CODE></FONT></TD>
157 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#read(byte[])">read</A></B>(byte[]&nbsp;b)</CODE>
158
159 <BR>
160 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads some number of bytes from the input stream and stores them into
161  the buffer array <code>b</code>.</TD>
162 </TR>
163 <TR BGCOLOR="white" CLASS="TableRowColor">
164 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
165 <CODE>&nbsp;int</CODE></FONT></TD>
166 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#read(byte[], int, int)">read</A></B>(byte[]&nbsp;b,
167      int&nbsp;off,
168      int&nbsp;len)</CODE>
169
170 <BR>
171 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads up to <code>len</code> bytes of data from the input stream into
172  an array of bytes.</TD>
173 </TR>
174 <TR BGCOLOR="white" CLASS="TableRowColor">
175 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
176 <CODE>&nbsp;boolean</CODE></FONT></TD>
177 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readBoolean()">readBoolean</A></B>()</CODE>
178
179 <BR>
180 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
181 </TR>
182 <TR BGCOLOR="white" CLASS="TableRowColor">
183 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
184 <CODE>&nbsp;byte</CODE></FONT></TD>
185 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readByte()">readByte</A></B>()</CODE>
186
187 <BR>
188 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
189 </TR>
190 <TR BGCOLOR="white" CLASS="TableRowColor">
191 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
192 <CODE>&nbsp;char</CODE></FONT></TD>
193 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readChar()">readChar</A></B>()</CODE>
194
195 <BR>
196 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
197 </TR>
198 <TR BGCOLOR="white" CLASS="TableRowColor">
199 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
200 <CODE>&nbsp;float</CODE></FONT></TD>
201 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readFloat()">readFloat</A></B>()</CODE>
202
203 <BR>
204 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
205 </TR>
206 <TR BGCOLOR="white" CLASS="TableRowColor">
207 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
208 <CODE>&nbsp;int</CODE></FONT></TD>
209 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readInt()">readInt</A></B>()</CODE>
210
211 <BR>
212 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
213 </TR>
214 <TR BGCOLOR="white" CLASS="TableRowColor">
215 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
216 <CODE>&nbsp;short</CODE></FONT></TD>
217 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readShort()">readShort</A></B>()</CODE>
218
219 <BR>
220 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
221 </TR>
222 </TABLE>
223 &nbsp;<A NAME="methods_inherited_from_class_java.io.InputStream"><!-- --></A>
224 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
225 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
226 <TH ALIGN="left"><B>Methods inherited from class java.io.<A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></B></TH>
227 </TR>
228 <TR BGCOLOR="white" CLASS="TableRowColor">
229 <TD><CODE><A HREF="../../java/io/InputStream.html#available()">available</A>, <A HREF="../../java/io/InputStream.html#close()">close</A>, <A HREF="../../java/io/InputStream.html#mark(int)">mark</A>, <A HREF="../../java/io/InputStream.html#markSupported()">markSupported</A>, <A HREF="../../java/io/InputStream.html#reset()">reset</A>, <A HREF="../../java/io/InputStream.html#skip(long)">skip</A></CODE></TD>
230 </TR>
231 </TABLE>
232 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
233 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
234 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
235 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
236 </TR>
237 <TR BGCOLOR="white" CLASS="TableRowColor">
238 <TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A></CODE></TD>
239 </TR>
240 </TABLE>
241 &nbsp;
242 <P>
243
244 <!-- ============ FIELD DETAIL =========== -->
245
246 <A NAME="field_detail"><!-- --></A>
247 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
248 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
249 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
250 <B>Field Detail</B></FONT></TH>
251 </TR>
252 </TABLE>
253
254 <A NAME="in"><!-- --></A><H3>
255 in</H3>
256 <PRE>
257 protected <A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A> <B>in</B></PRE>
258 <DL>
259 <DL>
260 </DL>
261 </DL>
262
263 <!-- ========= CONSTRUCTOR DETAIL ======== -->
264
265 <A NAME="constructor_detail"><!-- --></A>
266 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
267 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
268 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
269 <B>Constructor Detail</B></FONT></TH>
270 </TR>
271 </TABLE>
272
273 <A NAME="DataInputStream(java.io.InputStream)"><!-- --></A><H3>
274 DataInputStream</H3>
275 <PRE>
276 public <B>DataInputStream</B>(<A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A>&nbsp;in)</PRE>
277 <DL>
278 </DL>
279
280 <!-- ============ METHOD DETAIL ========== -->
281
282 <A NAME="method_detail"><!-- --></A>
283 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
284 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
285 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
286 <B>Method Detail</B></FONT></TH>
287 </TR>
288 </TABLE>
289
290 <A NAME="read()"><!-- --></A><H3>
291 read</H3>
292 <PRE>
293 public int <B>read</B>()
294          throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
295 <DL>
296 <DD>Reads the next byte of data from this input stream. The value 
297  byte is returned as an <code>int</code> in the range 
298  <code>0</code> to <code>255</code>. If no byte is available 
299  because the end of the stream has been reached, the value 
300  <code>-1</code> is returned. This method blocks until input data 
301  is available, the end of the stream is detected, or an exception 
302  is thrown. 
303  <p>
304  This method
305  simply performs <code>in.read()</code> and returns the result.
306 <P>
307 <DD><DL>
308 <DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read()">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
309 </DD>
310 <DD><DL>
311
312 <DT><B>Returns:</B><DD>the next byte of data, or <code>-1</code> if the end of the
313              stream is reached.
314 <DT><B>Throws:</B>
315 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><CODE>FilterInputStream.in</CODE></DL>
316 </DD>
317 </DL>
318 <HR>
319
320 <A NAME="read(byte[])"><!-- --></A><H3>
321 read</H3>
322 <PRE>
323 public final int <B>read</B>(byte[]&nbsp;b)
324                throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
325 <DL>
326 <DD><B>Description copied from class: <CODE><A HREF="../../java/io/InputStream.html#read(byte[])">InputStream</A></CODE></B></DD>
327 <DD>Reads some number of bytes from the input stream and stores them into
328  the buffer array <code>b</code>. The number of bytes actually read is
329  returned as an integer.  This method blocks until input data is
330  available, end of file is detected, or an exception is thrown.
331
332  <p> If <code>b</code> is <code>null</code>, a
333  <code>NullPointerException</code> is thrown.  If the length of
334  <code>b</code> is zero, then no bytes are read and <code>0</code> is
335  returned; otherwise, there is an attempt to read at least one byte. If
336  no byte is available because the stream is at end of file, the value
337  <code>-1</code> is returned; otherwise, at least one byte is read and
338  stored into <code>b</code>.
339
340  <p> The first byte read is stored into element <code>b[0]</code>, the
341  next one into <code>b[1]</code>, and so on. The number of bytes read is,
342  at most, equal to the length of <code>b</code>. Let <i>k</i> be the
343  number of bytes actually read; these bytes will be stored in elements
344  <code>b[0]</code> through <code>b[</code><i>k</i><code>-1]</code>,
345  leaving elements <code>b[</code><i>k</i><code>]</code> through
346  <code>b[b.length-1]</code> unaffected.
347
348  <p> If the first byte cannot be read for any reason other than end of
349  file, then an <code>IOException</code> is thrown. In particular, an
350  <code>IOException</code> is thrown if the input stream has been closed.
351
352  <p> The <code>read(b)</code> method for class <code>InputStream</code>
353  has the same effect as: <pre><code> read(b, 0, b.length) </code></pre>
354 <P>
355 <DD><DL>
356 <DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read(byte[])">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
357 </DD>
358 <DD><DL>
359 <DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read.
360 <DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or
361              <code>-1</code> is there is no more data because the end of
362              the stream has been reached.
363 <DT><B>Throws:</B>
364 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><A HREF="../../java/io/InputStream.html#read(byte[], int, int)"><CODE>InputStream.read(byte[], int, int)</CODE></A></DL>
365 </DD>
366 </DL>
367 <HR>
368
369 <A NAME="read(byte[], int, int)"><!-- --></A><H3>
370 read</H3>
371 <PRE>
372 public final int <B>read</B>(byte[]&nbsp;b,
373                       int&nbsp;off,
374                       int&nbsp;len)
375                throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
376 <DL>
377 <DD><B>Description copied from class: <CODE><A HREF="../../java/io/InputStream.html#read(byte[], int, int)">InputStream</A></CODE></B></DD>
378 <DD>Reads up to <code>len</code> bytes of data from the input stream into
379  an array of bytes.  An attempt is made to read as many as
380  <code>len</code> bytes, but a smaller number may be read, possibly
381  zero. The number of bytes actually read is returned as an integer.
382
383  <p> This method blocks until input data is available, end of file is
384  detected, or an exception is thrown.
385
386  <p> If <code>b</code> is <code>null</code>, a
387  <code>NullPointerException</code> is thrown.
388
389  <p> If <code>off</code> is negative, or <code>len</code> is negative, or
390  <code>off+len</code> is greater than the length of the array
391  <code>b</code>, then an <code>IndexOutOfBoundsException</code> is
392  thrown.
393
394  <p> If <code>len</code> is zero, then no bytes are read and
395  <code>0</code> is returned; otherwise, there is an attempt to read at
396  least one byte. If no byte is available because the stream is at end of
397  file, the value <code>-1</code> is returned; otherwise, at least one
398  byte is read and stored into <code>b</code>.
399
400  <p> The first byte read is stored into element <code>b[off]</code>, the
401  next one into <code>b[off+1]</code>, and so on. The number of bytes read
402  is, at most, equal to <code>len</code>. Let <i>k</i> be the number of
403  bytes actually read; these bytes will be stored in elements
404  <code>b[off]</code> through <code>b[off+</code><i>k</i><code>-1]</code>,
405  leaving elements <code>b[off+</code><i>k</i><code>]</code> through
406  <code>b[off+len-1]</code> unaffected.
407
408  <p> In every case, elements <code>b[0]</code> through
409  <code>b[off]</code> and elements <code>b[off+len]</code> through
410  <code>b[b.length-1]</code> are unaffected.
411
412  <p> If the first byte cannot be read for any reason other than end of
413  file, then an <code>IOException</code> is thrown. In particular, an
414  <code>IOException</code> is thrown if the input stream has been closed.
415
416  <p> The <code>read(b,</code> <code>off,</code> <code>len)</code> method
417  for class <code>InputStream</code> simply calls the method
418  <code>read()</code> repeatedly. If the first such call results in an
419  <code>IOException</code>, that exception is returned from the call to
420  the <code>read(b,</code> <code>off,</code> <code>len)</code> method.  If
421  any subsequent call to <code>read()</code> results in a
422  <code>IOException</code>, the exception is caught and treated as if it
423  were end of file; the bytes read up to that point are stored into
424  <code>b</code> and the number of bytes read before the exception
425  occurred is returned.  Subclasses are encouraged to provide a more
426  efficient implementation of this method.
427 <P>
428 <DD><DL>
429 <DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#read(byte[], int, int)">read</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
430 </DD>
431 <DD><DL>
432 <DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read.<DD><CODE>off</CODE> - the start offset in array <code>b</code>
433                    at which the data is written.<DD><CODE>len</CODE> - the maximum number of bytes to read.
434 <DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or
435              <code>-1</code> if there is no more data because the end of
436              the stream has been reached.
437 <DT><B>Throws:</B>
438 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><A HREF="../../java/io/InputStream.html#read()"><CODE>InputStream.read()</CODE></A></DL>
439 </DD>
440 </DL>
441 <HR>
442
443 <A NAME="readBoolean()"><!-- --></A><H3>
444 readBoolean</H3>
445 <PRE>
446 public final boolean <B>readBoolean</B>()
447                           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
448 <DL>
449 <DD><DL>
450
451 <DT><B>Throws:</B>
452 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
453 </DD>
454 </DL>
455 <HR>
456
457 <A NAME="readByte()"><!-- --></A><H3>
458 readByte</H3>
459 <PRE>
460 public final byte <B>readByte</B>()
461                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
462 <DL>
463 <DD><DL>
464
465 <DT><B>Throws:</B>
466 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
467 </DD>
468 </DL>
469 <HR>
470
471 <A NAME="readShort()"><!-- --></A><H3>
472 readShort</H3>
473 <PRE>
474 public final short <B>readShort</B>()
475                       throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
476 <DL>
477 <DD><DL>
478
479 <DT><B>Throws:</B>
480 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
481 </DD>
482 </DL>
483 <HR>
484
485 <A NAME="readChar()"><!-- --></A><H3>
486 readChar</H3>
487 <PRE>
488 public final char <B>readChar</B>()
489                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
490 <DL>
491 <DD><DL>
492
493 <DT><B>Throws:</B>
494 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
495 </DD>
496 </DL>
497 <HR>
498
499 <A NAME="readInt()"><!-- --></A><H3>
500 readInt</H3>
501 <PRE>
502 public final int <B>readInt</B>()
503                   throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
504 <DL>
505 <DD><DL>
506
507 <DT><B>Throws:</B>
508 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
509 </DD>
510 </DL>
511 <HR>
512
513 <A NAME="readFloat()"><!-- --></A><H3>
514 readFloat</H3>
515 <PRE>
516 public final float <B>readFloat</B>()
517                       throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
518 <DL>
519 <DD><DL>
520
521 <DT><B>Throws:</B>
522 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
523 </DD>
524 </DL>
525 <!-- ========= END OF CLASS DATA ========= -->
526 <HR>
527
528
529 <!-- ======= START OF BOTTOM NAVBAR ====== -->
530 <A NAME="navbar_bottom"><!-- --></A>
531 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
532 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
533 <TR>
534 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
535 <A NAME="navbar_bottom_firstrow"><!-- --></A>
536 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
537   <TR ALIGN="center" VALIGN="top">
538   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
539   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
540   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
541   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
542   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
543   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
544   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
545   </TR>
546 </TABLE>
547 </TD>
548 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
549 </EM>
550 </TD>
551 </TR>
552
553 <TR>
554 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
555 &nbsp;PREV CLASS&nbsp;
556 &nbsp;<A HREF="../../java/io/DataOutputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
557 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
558   <A HREF="../../index.html?java/io/DataInputStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
559 &nbsp;<A HREF="DataInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
560 &nbsp;<SCRIPT type="text/javascript">
561   <!--
562   if(window==top) {
563     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
564   }
565   //-->
566 </SCRIPT>
567 <NOSCRIPT>
568   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
569 </NOSCRIPT>
570
571
572 </FONT></TD>
573 </TR>
574 <TR>
575 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
576   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
577 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
578 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
579 </TR>
580 </TABLE>
581 <A NAME="skip-navbar_bottom"></A>
582 <!-- ======== END OF BOTTOM NAVBAR ======= -->
583
584 <HR>
585
586 </BODY>
587 </HTML>