OSDN Git Service

f30c308ce28b7b42a4751daf50be1eb2e081574c
[nxt-jsp/lejos_nxj.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 Sun Sep 02 23:07:08 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;void</CODE></FONT></TD>
149 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#close()">close</A></B>()</CODE>
150
151 <BR>
152 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes this input stream and releases any system resources associated
153  with the stream.</TD>
154 </TR>
155 <TR BGCOLOR="white" CLASS="TableRowColor">
156 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157 <CODE>&nbsp;int</CODE></FONT></TD>
158 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#read()">read</A></B>()</CODE>
159
160 <BR>
161 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads the next byte of data from this input stream.</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[])">read</A></B>(byte[]&nbsp;b)</CODE>
167
168 <BR>
169 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads some number of bytes from the input stream and stores them into
170  the buffer array <code>b</code>.</TD>
171 </TR>
172 <TR BGCOLOR="white" CLASS="TableRowColor">
173 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
174 <CODE>&nbsp;int</CODE></FONT></TD>
175 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#read(byte[], int, int)">read</A></B>(byte[]&nbsp;b,
176      int&nbsp;off,
177      int&nbsp;len)</CODE>
178
179 <BR>
180 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads up to <code>len</code> bytes of data from the input stream into
181  an array of bytes.</TD>
182 </TR>
183 <TR BGCOLOR="white" CLASS="TableRowColor">
184 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
185 <CODE>&nbsp;boolean</CODE></FONT></TD>
186 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readBoolean()">readBoolean</A></B>()</CODE>
187
188 <BR>
189 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
190 </TR>
191 <TR BGCOLOR="white" CLASS="TableRowColor">
192 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193 <CODE>&nbsp;byte</CODE></FONT></TD>
194 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readByte()">readByte</A></B>()</CODE>
195
196 <BR>
197 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
198 </TR>
199 <TR BGCOLOR="white" CLASS="TableRowColor">
200 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
201 <CODE>&nbsp;char</CODE></FONT></TD>
202 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readChar()">readChar</A></B>()</CODE>
203
204 <BR>
205 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
206 </TR>
207 <TR BGCOLOR="white" CLASS="TableRowColor">
208 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
209 <CODE>&nbsp;float</CODE></FONT></TD>
210 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readFloat()">readFloat</A></B>()</CODE>
211
212 <BR>
213 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
214 </TR>
215 <TR BGCOLOR="white" CLASS="TableRowColor">
216 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
217 <CODE>&nbsp;int</CODE></FONT></TD>
218 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readInt()">readInt</A></B>()</CODE>
219
220 <BR>
221 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
222 </TR>
223 <TR BGCOLOR="white" CLASS="TableRowColor">
224 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
225 <CODE>&nbsp;<A HREF="../../java/lang/String.html" title="class in java.lang">String</A></CODE></FONT></TD>
226 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readLine()">readLine</A></B>()</CODE>
227
228 <BR>
229 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
230 </TR>
231 <TR BGCOLOR="white" CLASS="TableRowColor">
232 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
233 <CODE>&nbsp;short</CODE></FONT></TD>
234 <TD><CODE><B><A HREF="../../java/io/DataInputStream.html#readShort()">readShort</A></B>()</CODE>
235
236 <BR>
237 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
238 </TR>
239 </TABLE>
240 &nbsp;<A NAME="methods_inherited_from_class_java.io.InputStream"><!-- --></A>
241 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
242 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
243 <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>
244 </TR>
245 <TR BGCOLOR="white" CLASS="TableRowColor">
246 <TD><CODE><A HREF="../../java/io/InputStream.html#available()">available</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>
247 </TR>
248 </TABLE>
249 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
250 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
251 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
252 <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>
253 </TR>
254 <TR BGCOLOR="white" CLASS="TableRowColor">
255 <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>
256 </TR>
257 </TABLE>
258 &nbsp;
259 <P>
260
261 <!-- ============ FIELD DETAIL =========== -->
262
263 <A NAME="field_detail"><!-- --></A>
264 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
265 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
266 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
267 <B>Field Detail</B></FONT></TH>
268 </TR>
269 </TABLE>
270
271 <A NAME="in"><!-- --></A><H3>
272 in</H3>
273 <PRE>
274 protected <A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A> <B>in</B></PRE>
275 <DL>
276 <DL>
277 </DL>
278 </DL>
279
280 <!-- ========= CONSTRUCTOR DETAIL ======== -->
281
282 <A NAME="constructor_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>Constructor Detail</B></FONT></TH>
287 </TR>
288 </TABLE>
289
290 <A NAME="DataInputStream(java.io.InputStream)"><!-- --></A><H3>
291 DataInputStream</H3>
292 <PRE>
293 public <B>DataInputStream</B>(<A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A>&nbsp;in)</PRE>
294 <DL>
295 </DL>
296
297 <!-- ============ METHOD DETAIL ========== -->
298
299 <A NAME="method_detail"><!-- --></A>
300 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
301 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
302 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
303 <B>Method Detail</B></FONT></TH>
304 </TR>
305 </TABLE>
306
307 <A NAME="read()"><!-- --></A><H3>
308 read</H3>
309 <PRE>
310 public int <B>read</B>()
311          throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
312 <DL>
313 <DD>Reads the next byte of data from this input stream. The value 
314  byte is returned as an <code>int</code> in the range 
315  <code>0</code> to <code>255</code>. If no byte is available 
316  because the end of the stream has been reached, the value 
317  <code>-1</code> is returned. This method blocks until input data 
318  is available, the end of the stream is detected, or an exception 
319  is thrown. 
320  <p>
321  This method
322  simply performs <code>in.read()</code> and returns the result.
323 <P>
324 <DD><DL>
325 <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>
326 </DD>
327 <DD><DL>
328
329 <DT><B>Returns:</B><DD>the next byte of data, or <code>-1</code> if the end of the
330              stream is reached.
331 <DT><B>Throws:</B>
332 <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>
333 </DD>
334 </DL>
335 <HR>
336
337 <A NAME="read(byte[])"><!-- --></A><H3>
338 read</H3>
339 <PRE>
340 public final int <B>read</B>(byte[]&nbsp;b)
341                throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
342 <DL>
343 <DD><B>Description copied from class: <CODE><A HREF="../../java/io/InputStream.html#read(byte[])">InputStream</A></CODE></B></DD>
344 <DD>Reads some number of bytes from the input stream and stores them into
345  the buffer array <code>b</code>. The number of bytes actually read is
346  returned as an integer.  This method blocks until input data is
347  available, end of file is detected, or an exception is thrown.
348
349  <p> If <code>b</code> is <code>null</code>, a
350  <code>NullPointerException</code> is thrown.  If the length of
351  <code>b</code> is zero, then no bytes are read and <code>0</code> is
352  returned; otherwise, there is an attempt to read at least one byte. If
353  no byte is available because the stream is at end of file, the value
354  <code>-1</code> is returned; otherwise, at least one byte is read and
355  stored into <code>b</code>.
356
357  <p> The first byte read is stored into element <code>b[0]</code>, the
358  next one into <code>b[1]</code>, and so on. The number of bytes read is,
359  at most, equal to the length of <code>b</code>. Let <i>k</i> be the
360  number of bytes actually read; these bytes will be stored in elements
361  <code>b[0]</code> through <code>b[</code><i>k</i><code>-1]</code>,
362  leaving elements <code>b[</code><i>k</i><code>]</code> through
363  <code>b[b.length-1]</code> unaffected.
364
365  <p> If the first byte cannot be read for any reason other than end of
366  file, then an <code>IOException</code> is thrown. In particular, an
367  <code>IOException</code> is thrown if the input stream has been closed.
368
369  <p> The <code>read(b)</code> method for class <code>InputStream</code>
370  has the same effect as: <pre><code> read(b, 0, b.length) </code></pre>
371 <P>
372 <DD><DL>
373 <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>
374 </DD>
375 <DD><DL>
376 <DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read.
377 <DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or
378              <code>-1</code> is there is no more data because the end of
379              the stream has been reached.
380 <DT><B>Throws:</B>
381 <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>
382 </DD>
383 </DL>
384 <HR>
385
386 <A NAME="read(byte[], int, int)"><!-- --></A><H3>
387 read</H3>
388 <PRE>
389 public final int <B>read</B>(byte[]&nbsp;b,
390                       int&nbsp;off,
391                       int&nbsp;len)
392                throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
393 <DL>
394 <DD><B>Description copied from class: <CODE><A HREF="../../java/io/InputStream.html#read(byte[], int, int)">InputStream</A></CODE></B></DD>
395 <DD>Reads up to <code>len</code> bytes of data from the input stream into
396  an array of bytes.  An attempt is made to read as many as
397  <code>len</code> bytes, but a smaller number may be read, possibly
398  zero. The number of bytes actually read is returned as an integer.
399
400  <p> This method blocks until input data is available, end of file is
401  detected, or an exception is thrown.
402
403  <p> If <code>b</code> is <code>null</code>, a
404  <code>NullPointerException</code> is thrown.
405
406  <p> If <code>off</code> is negative, or <code>len</code> is negative, or
407  <code>off+len</code> is greater than the length of the array
408  <code>b</code>, then an <code>IndexOutOfBoundsException</code> is
409  thrown.
410
411  <p> If <code>len</code> is zero, then no bytes are read and
412  <code>0</code> is returned; otherwise, there is an attempt to read at
413  least one byte. If no byte is available because the stream is at end of
414  file, the value <code>-1</code> is returned; otherwise, at least one
415  byte is read and stored into <code>b</code>.
416
417  <p> The first byte read is stored into element <code>b[off]</code>, the
418  next one into <code>b[off+1]</code>, and so on. The number of bytes read
419  is, at most, equal to <code>len</code>. Let <i>k</i> be the number of
420  bytes actually read; these bytes will be stored in elements
421  <code>b[off]</code> through <code>b[off+</code><i>k</i><code>-1]</code>,
422  leaving elements <code>b[off+</code><i>k</i><code>]</code> through
423  <code>b[off+len-1]</code> unaffected.
424
425  <p> In every case, elements <code>b[0]</code> through
426  <code>b[off]</code> and elements <code>b[off+len]</code> through
427  <code>b[b.length-1]</code> are unaffected.
428
429  <p> If the first byte cannot be read for any reason other than end of
430  file, then an <code>IOException</code> is thrown. In particular, an
431  <code>IOException</code> is thrown if the input stream has been closed.
432
433  <p> The <code>read(b,</code> <code>off,</code> <code>len)</code> method
434  for class <code>InputStream</code> simply calls the method
435  <code>read()</code> repeatedly. If the first such call results in an
436  <code>IOException</code>, that exception is returned from the call to
437  the <code>read(b,</code> <code>off,</code> <code>len)</code> method.  If
438  any subsequent call to <code>read()</code> results in a
439  <code>IOException</code>, the exception is caught and treated as if it
440  were end of file; the bytes read up to that point are stored into
441  <code>b</code> and the number of bytes read before the exception
442  occurred is returned.  Subclasses are encouraged to provide a more
443  efficient implementation of this method.
444 <P>
445 <DD><DL>
446 <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>
447 </DD>
448 <DD><DL>
449 <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>
450                    at which the data is written.<DD><CODE>len</CODE> - the maximum number of bytes to read.
451 <DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or
452              <code>-1</code> if there is no more data because the end of
453              the stream has been reached.
454 <DT><B>Throws:</B>
455 <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>
456 </DD>
457 </DL>
458 <HR>
459
460 <A NAME="readBoolean()"><!-- --></A><H3>
461 readBoolean</H3>
462 <PRE>
463 public final boolean <B>readBoolean</B>()
464                           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
465 <DL>
466 <DD><DL>
467
468 <DT><B>Throws:</B>
469 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
470 </DD>
471 </DL>
472 <HR>
473
474 <A NAME="readByte()"><!-- --></A><H3>
475 readByte</H3>
476 <PRE>
477 public final byte <B>readByte</B>()
478                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
479 <DL>
480 <DD><DL>
481
482 <DT><B>Throws:</B>
483 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
484 </DD>
485 </DL>
486 <HR>
487
488 <A NAME="readShort()"><!-- --></A><H3>
489 readShort</H3>
490 <PRE>
491 public final short <B>readShort</B>()
492                       throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
493 <DL>
494 <DD><DL>
495
496 <DT><B>Throws:</B>
497 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
498 </DD>
499 </DL>
500 <HR>
501
502 <A NAME="readInt()"><!-- --></A><H3>
503 readInt</H3>
504 <PRE>
505 public final int <B>readInt</B>()
506                   throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
507 <DL>
508 <DD><DL>
509
510 <DT><B>Throws:</B>
511 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
512 </DD>
513 </DL>
514 <HR>
515
516 <A NAME="readChar()"><!-- --></A><H3>
517 readChar</H3>
518 <PRE>
519 public final char <B>readChar</B>()
520                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
521 <DL>
522 <DD><DL>
523
524 <DT><B>Throws:</B>
525 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
526 </DD>
527 </DL>
528 <HR>
529
530 <A NAME="readFloat()"><!-- --></A><H3>
531 readFloat</H3>
532 <PRE>
533 public final float <B>readFloat</B>()
534                       throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
535 <DL>
536 <DD><DL>
537
538 <DT><B>Throws:</B>
539 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
540 </DD>
541 </DL>
542 <HR>
543
544 <A NAME="readLine()"><!-- --></A><H3>
545 readLine</H3>
546 <PRE>
547 public <A HREF="../../java/lang/String.html" title="class in java.lang">String</A> <B>readLine</B>()
548                 throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
549 <DL>
550 <DD><DL>
551
552 <DT><B>Throws:</B>
553 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE></DL>
554 </DD>
555 </DL>
556 <HR>
557
558 <A NAME="close()"><!-- --></A><H3>
559 close</H3>
560 <PRE>
561 public void <B>close</B>()
562            throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
563 <DL>
564 <DD><B>Description copied from class: <CODE><A HREF="../../java/io/InputStream.html#close()">InputStream</A></CODE></B></DD>
565 <DD>Closes this input stream and releases any system resources associated
566  with the stream.
567
568  <p> The <code>close</code> method of <code>InputStream</code> does
569  nothing.
570 <P>
571 <DD><DL>
572 <DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/InputStream.html#close()">close</A></CODE> in class <CODE><A HREF="../../java/io/InputStream.html" title="class in java.io">InputStream</A></CODE></DL>
573 </DD>
574 <DD><DL>
575
576 <DT><B>Throws:</B>
577 <DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
578 </DD>
579 </DL>
580 <!-- ========= END OF CLASS DATA ========= -->
581 <HR>
582
583
584 <!-- ======= START OF BOTTOM NAVBAR ====== -->
585 <A NAME="navbar_bottom"><!-- --></A>
586 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
587 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
588 <TR>
589 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
590 <A NAME="navbar_bottom_firstrow"><!-- --></A>
591 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
592   <TR ALIGN="center" VALIGN="top">
593   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
594   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
595   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
596   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
597   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
598   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
599   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
600   </TR>
601 </TABLE>
602 </TD>
603 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
604 </EM>
605 </TD>
606 </TR>
607
608 <TR>
609 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
610 &nbsp;PREV CLASS&nbsp;
611 &nbsp;<A HREF="../../java/io/DataOutputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
612 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
613   <A HREF="../../index.html?java/io/DataInputStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
614 &nbsp;<A HREF="DataInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
615 &nbsp;<SCRIPT type="text/javascript">
616   <!--
617   if(window==top) {
618     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
619   }
620   //-->
621 </SCRIPT>
622 <NOSCRIPT>
623   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
624 </NOSCRIPT>
625
626
627 </FONT></TD>
628 </TR>
629 <TR>
630 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
631   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>
632 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
633 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>
634 </TR>
635 </TABLE>
636 <A NAME="skip-navbar_bottom"></A>
637 <!-- ======== END OF BOTTOM NAVBAR ======= -->
638
639 <HR>
640
641 </BODY>
642 </HTML>