source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/api/org/apache/hadoop/net/SocketInputStream.html @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 28.6 KB
Line 
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.6.0_07) on Tue Sep 01 20:56:54 UTC 2009 -->
6<TITLE>
7SocketInputStream (Hadoop 0.20.1 API)
8</TITLE>
9
10<META NAME="date" CONTENT="2009-09-01">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="SocketInputStream (Hadoop 0.20.1 API)";
19    }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39  <TR ALIGN="center" VALIGN="top">
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SocketInputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../org/apache/hadoop/net/ScriptBasedMapping.html" title="class in org.apache.hadoop.net"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html" title="class in org.apache.hadoop.net"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../index.html?org/apache/hadoop/net/SocketInputStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="SocketInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<SCRIPT type="text/javascript">
64  <!--
65  if(window==top) {
66    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67  }
68  //-->
69</SCRIPT>
70<NOSCRIPT>
71  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
72</NOSCRIPT>
73
74
75</FONT></TD>
76</TR>
77<TR>
78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82</TR>
83</TABLE>
84<A NAME="skip-navbar_top"></A>
85<!-- ========= END OF TOP NAVBAR ========= -->
86
87<HR>
88<!-- ======== START OF CLASS DATA ======== -->
89<H2>
90<FONT SIZE="-1">
91org.apache.hadoop.net</FONT>
92<BR>
93Class SocketInputStream</H2>
94<PRE>
95<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">java.io.InputStream</A>
97      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.net.SocketInputStream</B>
98</PRE>
99<DL>
100<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/Channel.html?is-external=true" title="class or interface in java.nio.channels">Channel</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A></DD>
101</DL>
102<HR>
103<DL>
104<DT><PRE>public class <B>SocketInputStream</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A><DT>implements <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A></DL>
105</PRE>
106
107<P>
108This implements an input stream that can have a timeout while reading.
109 This sets non-blocking flag on the socket channel.
110 So after create this object, read() on
111 <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getInputStream()" title="class or interface in java.net"><CODE>Socket.getInputStream()</CODE></A> and write() on
112 <A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true#getOutputStream()" title="class or interface in java.net"><CODE>Socket.getOutputStream()</CODE></A> for the associated socket will throw
113 IllegalBlockingModeException.
114 Please use <A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html" title="class in org.apache.hadoop.net"><CODE>SocketOutputStream</CODE></A> for writing.
115<P>
116
117<P>
118<HR>
119
120<P>
121
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="../../../../org/apache/hadoop/net/SocketInputStream.html#SocketInputStream(java.nio.channels.ReadableByteChannel, long)">SocketInputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A>&nbsp;channel,
132                  long&nbsp;timeout)</CODE>
133
134<BR>
135&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new input stream with the given timeout.</TD>
136</TR>
137<TR BGCOLOR="white" CLASS="TableRowColor">
138<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#SocketInputStream(java.net.Socket)">SocketInputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A>&nbsp;socket)</CODE>
139
140<BR>
141&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Same as SocketInputStream(socket.getChannel(), socket.getSoTimeout())
142 :<br><br>
143 
144 Create a new input stream with the given timeout.</TD>
145</TR>
146<TR BGCOLOR="white" CLASS="TableRowColor">
147<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#SocketInputStream(java.net.Socket, long)">SocketInputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A>&nbsp;socket,
148                  long&nbsp;timeout)</CODE>
149
150<BR>
151&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Same as SocketInputStream(socket.getChannel(), timeout): <br><br>
152 
153 Create a new input stream with the given timeout.</TD>
154</TR>
155</TABLE>
156&nbsp;
157<!-- ========== METHOD SUMMARY =========== -->
158
159<A NAME="method_summary"><!-- --></A>
160<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
161<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
162<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
163<B>Method Summary</B></FONT></TH>
164</TR>
165<TR BGCOLOR="white" CLASS="TableRowColor">
166<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
167<CODE>&nbsp;void</CODE></FONT></TD>
168<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#close()">close</A></B>()</CODE>
169
170<BR>
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
172</TR>
173<TR BGCOLOR="white" CLASS="TableRowColor">
174<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
175<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A></CODE></FONT></TD>
176<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#getChannel()">getChannel</A></B>()</CODE>
177
178<BR>
179&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns underlying channel used by inputstream.</TD>
180</TR>
181<TR BGCOLOR="white" CLASS="TableRowColor">
182<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
183<CODE>&nbsp;boolean</CODE></FONT></TD>
184<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#isOpen()">isOpen</A></B>()</CODE>
185
186<BR>
187&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
188</TR>
189<TR BGCOLOR="white" CLASS="TableRowColor">
190<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
191<CODE>&nbsp;int</CODE></FONT></TD>
192<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#read()">read</A></B>()</CODE>
193
194<BR>
195&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
196</TR>
197<TR BGCOLOR="white" CLASS="TableRowColor">
198<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
199<CODE>&nbsp;int</CODE></FONT></TD>
200<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#read(byte[], int, int)">read</A></B>(byte[]&nbsp;b,
201     int&nbsp;off,
202     int&nbsp;len)</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;int</CODE></FONT></TD>
210<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#read(java.nio.ByteBuffer)">read</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;dst)</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;void</CODE></FONT></TD>
218<TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#waitForReadable()">waitForReadable</A></B>()</CODE>
219
220<BR>
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;waits for the underlying channel to be ready for reading.</TD>
222</TR>
223</TABLE>
224&nbsp;<A NAME="methods_inherited_from_class_java.io.InputStream"><!-- --></A>
225<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
226<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
227<TH ALIGN="left"><B>Methods inherited from class java.io.<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></B></TH>
228</TR>
229<TR BGCOLOR="white" CLASS="TableRowColor">
230<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#available()" title="class or interface in java.io">available</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#mark(int)" title="class or interface in java.io">mark</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#markSupported()" title="class or interface in java.io">markSupported</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#read(byte[])" title="class or interface in java.io">read</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#reset()" title="class or interface in java.io">reset</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#skip(long)" title="class or interface in java.io">skip</A></CODE></TD>
231</TR>
232</TABLE>
233&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
234<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
235<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
236<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
237</TR>
238<TR BGCOLOR="white" CLASS="TableRowColor">
239<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
240</TR>
241</TABLE>
242&nbsp;
243<P>
244
245<!-- ========= CONSTRUCTOR DETAIL ======== -->
246
247<A NAME="constructor_detail"><!-- --></A>
248<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
249<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
250<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
251<B>Constructor Detail</B></FONT></TH>
252</TR>
253</TABLE>
254
255<A NAME="SocketInputStream(java.nio.channels.ReadableByteChannel, long)"><!-- --></A><H3>
256SocketInputStream</H3>
257<PRE>
258public <B>SocketInputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A>&nbsp;channel,
259                         long&nbsp;timeout)
260                  throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
261<DL>
262<DD>Create a new input stream with the given timeout. If the timeout
263 is zero, it will be treated as infinite timeout. The socket's
264 channel will be configured to be non-blocking.
265<P>
266<DL>
267<DT><B>Parameters:</B><DD><CODE>channel</CODE> - Channel for reading, should also be a <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/SelectableChannel.html?is-external=true" title="class or interface in java.nio.channels"><CODE>SelectableChannel</CODE></A>.
268        The channel will be configured to be non-blocking.<DD><CODE>timeout</CODE> - timeout in milliseconds. must not be negative.
269<DT><B>Throws:</B>
270<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
271</DL>
272<HR>
273
274<A NAME="SocketInputStream(java.net.Socket, long)"><!-- --></A><H3>
275SocketInputStream</H3>
276<PRE>
277public <B>SocketInputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A>&nbsp;socket,
278                         long&nbsp;timeout)
279                  throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
280<DL>
281<DD>Same as SocketInputStream(socket.getChannel(), timeout): <br><br>
282 
283 Create a new input stream with the given timeout. If the timeout
284 is zero, it will be treated as infinite timeout. The socket's
285 channel will be configured to be non-blocking.
286<P>
287<DL>
288<DT><B>Parameters:</B><DD><CODE>socket</CODE> - should have a channel associated with it.<DD><CODE>timeout</CODE> - timeout timeout in milliseconds. must not be negative.
289<DT><B>Throws:</B>
290<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#SocketInputStream(java.nio.channels.ReadableByteChannel, long)"><CODE>SocketInputStream(ReadableByteChannel, long)</CODE></A></DL>
291</DL>
292<HR>
293
294<A NAME="SocketInputStream(java.net.Socket)"><!-- --></A><H3>
295SocketInputStream</H3>
296<PRE>
297public <B>SocketInputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/net/Socket.html?is-external=true" title="class or interface in java.net">Socket</A>&nbsp;socket)
298                  throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
299<DL>
300<DD>Same as SocketInputStream(socket.getChannel(), socket.getSoTimeout())
301 :<br><br>
302 
303 Create a new input stream with the given timeout. If the timeout
304 is zero, it will be treated as infinite timeout. The socket's
305 channel will be configured to be non-blocking.
306<P>
307<DL>
308<DT><B>Parameters:</B><DD><CODE>socket</CODE> - should have a channel associated with it.
309<DT><B>Throws:</B>
310<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html#SocketInputStream(java.nio.channels.ReadableByteChannel, long)"><CODE>SocketInputStream(ReadableByteChannel, long)</CODE></A></DL>
311</DL>
312
313<!-- ============ METHOD DETAIL ========== -->
314
315<A NAME="method_detail"><!-- --></A>
316<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
317<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
318<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
319<B>Method Detail</B></FONT></TH>
320</TR>
321</TABLE>
322
323<A NAME="read()"><!-- --></A><H3>
324read</H3>
325<PRE>
326public int <B>read</B>()
327         throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
328<DL>
329<DD><DL>
330<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#read()" title="class or interface in java.io">read</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></DL>
331</DD>
332<DD><DL>
333
334<DT><B>Throws:</B>
335<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
336</DD>
337</DL>
338<HR>
339
340<A NAME="read(byte[], int, int)"><!-- --></A><H3>
341read</H3>
342<PRE>
343public int <B>read</B>(byte[]&nbsp;b,
344                int&nbsp;off,
345                int&nbsp;len)
346         throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
347<DL>
348<DD><DL>
349<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#read(byte[], int, int)" title="class or interface in java.io">read</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></DL>
350</DD>
351<DD><DL>
352
353<DT><B>Throws:</B>
354<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
355</DD>
356</DL>
357<HR>
358
359<A NAME="close()"><!-- --></A><H3>
360close</H3>
361<PRE>
362public void <B>close</B>()
363           throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
364<DL>
365<DD><DL>
366<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io">close</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/Channel.html?is-external=true#close()" title="class or interface in java.nio.channels">close</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/Channel.html?is-external=true" title="class or interface in java.nio.channels">Channel</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true#close()" title="class or interface in java.io">close</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></DL>
367</DD>
368<DD><DL>
369
370<DT><B>Throws:</B>
371<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
372</DD>
373</DL>
374<HR>
375
376<A NAME="getChannel()"><!-- --></A><H3>
377getChannel</H3>
378<PRE>
379public <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A> <B>getChannel</B>()</PRE>
380<DL>
381<DD>Returns underlying channel used by inputstream.
382 This is useful in certain cases like channel for
383 <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true#transferFrom(java.nio.channels.ReadableByteChannel, long, long)" title="class or interface in java.nio.channels"><CODE>FileChannel.transferFrom(ReadableByteChannel, long, long)</CODE></A>.
384<P>
385<DD><DL>
386</DL>
387</DD>
388<DD><DL>
389</DL>
390</DD>
391</DL>
392<HR>
393
394<A NAME="isOpen()"><!-- --></A><H3>
395isOpen</H3>
396<PRE>
397public boolean <B>isOpen</B>()</PRE>
398<DL>
399<DD><DL>
400<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/Channel.html?is-external=true#isOpen()" title="class or interface in java.nio.channels">isOpen</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/Channel.html?is-external=true" title="class or interface in java.nio.channels">Channel</A></CODE></DL>
401</DD>
402<DD><DL>
403</DL>
404</DD>
405</DL>
406<HR>
407
408<A NAME="read(java.nio.ByteBuffer)"><!-- --></A><H3>
409read</H3>
410<PRE>
411public int <B>read</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;dst)
412         throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
413<DL>
414<DD><DL>
415<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true#read(java.nio.ByteBuffer)" title="class or interface in java.nio.channels">read</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/ReadableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">ReadableByteChannel</A></CODE></DL>
416</DD>
417<DD><DL>
418
419<DT><B>Throws:</B>
420<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
421</DD>
422</DL>
423<HR>
424
425<A NAME="waitForReadable()"><!-- --></A><H3>
426waitForReadable</H3>
427<PRE>
428public void <B>waitForReadable</B>()
429                     throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
430<DL>
431<DD>waits for the underlying channel to be ready for reading.
432 The timeout specified for this stream applies to this wait.
433<P>
434<DD><DL>
435</DL>
436</DD>
437<DD><DL>
438
439<DT><B>Throws:</B>
440<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/net/SocketTimeoutException.html?is-external=true" title="class or interface in java.net">SocketTimeoutException</A></CODE> - if select on the channel times out.
441<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if any other I/O error occurs.</DL>
442</DD>
443</DL>
444<!-- ========= END OF CLASS DATA ========= -->
445<HR>
446
447
448<!-- ======= START OF BOTTOM NAVBAR ====== -->
449<A NAME="navbar_bottom"><!-- --></A>
450<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
451<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
452<TR>
453<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
454<A NAME="navbar_bottom_firstrow"><!-- --></A>
455<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
456  <TR ALIGN="center" VALIGN="top">
457  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
458  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
459  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
460  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SocketInputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
461  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
462  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
463  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
464  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
465  </TR>
466</TABLE>
467</TD>
468<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
469</EM>
470</TD>
471</TR>
472
473<TR>
474<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
475&nbsp;<A HREF="../../../../org/apache/hadoop/net/ScriptBasedMapping.html" title="class in org.apache.hadoop.net"><B>PREV CLASS</B></A>&nbsp;
476&nbsp;<A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html" title="class in org.apache.hadoop.net"><B>NEXT CLASS</B></A></FONT></TD>
477<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
478  <A HREF="../../../../index.html?org/apache/hadoop/net/SocketInputStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;
479&nbsp;<A HREF="SocketInputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
480&nbsp;<SCRIPT type="text/javascript">
481  <!--
482  if(window==top) {
483    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
484  }
485  //-->
486</SCRIPT>
487<NOSCRIPT>
488  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
489</NOSCRIPT>
490
491
492</FONT></TD>
493</TR>
494<TR>
495<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
496  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
497<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
498DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
499</TR>
500</TABLE>
501<A NAME="skip-navbar_bottom"></A>
502<!-- ======== END OF BOTTOM NAVBAR ======= -->
503
504<HR>
505Copyright &copy; 2009 The Apache Software Foundation
506</BODY>
507</HTML>
Note: See TracBrowser for help on using the repository browser.