[120] | 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> |
---|
| 7 | SocketOutputStream (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"> |
---|
| 15 | function windowTitle() |
---|
| 16 | { |
---|
| 17 | if (location.href.indexOf('is-external=true') == -1) { |
---|
| 18 | parent.document.title="SocketOutputStream (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> </TD> |
---|
| 41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
| 42 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
| 43 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SocketOutputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
| 44 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
| 45 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
| 46 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
| 47 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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 | <A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html" title="class in org.apache.hadoop.net"><B>PREV CLASS</B></A> |
---|
| 59 | <A HREF="../../../../org/apache/hadoop/net/SocksSocketFactory.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/SocketOutputStream.html" target="_top"><B>FRAMES</B></A> |
---|
| 62 | <A HREF="SocketOutputStream.html" target="_top"><B>NO FRAMES</B></A> |
---|
| 63 | <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 81 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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"> |
---|
| 91 | org.apache.hadoop.net</FONT> |
---|
| 92 | <BR> |
---|
| 93 | Class SocketOutputStream</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/OutputStream.html?is-external=true" title="class or interface in java.io">java.io.OutputStream</A> |
---|
| 97 | <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.net.SocketOutputStream</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/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</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/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A></DD> |
---|
| 101 | </DL> |
---|
| 102 | <HR> |
---|
| 103 | <DL> |
---|
| 104 | <DT><PRE>public class <B>SocketOutputStream</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A><DT>implements <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A></DL> |
---|
| 105 | </PRE> |
---|
| 106 | |
---|
| 107 | <P> |
---|
| 108 | This implements an output stream that can have a timeout while writing. |
---|
| 109 | This sets non-blocking flag on the socket channel. |
---|
| 110 | So after creating 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> on the associated socket will throw |
---|
| 113 | llegalBlockingModeException. |
---|
| 114 | Please use <A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html" title="class in org.apache.hadoop.net"><CODE>SocketInputStream</CODE></A> for reading. |
---|
| 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/SocketOutputStream.html#SocketOutputStream(java.net.Socket, long)">SocketOutputStream</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> socket, |
---|
| 132 | long timeout)</CODE> |
---|
| 133 | |
---|
| 134 | <BR> |
---|
| 135 | Same as SocketOutputStream(socket.getChannel(), timeout):<br><br> |
---|
| 136 | |
---|
| 137 | Create a new ouput stream with the given timeout.</TD> |
---|
| 138 | </TR> |
---|
| 139 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 140 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#SocketOutputStream(java.nio.channels.WritableByteChannel, long)">SocketOutputStream</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A> channel, |
---|
| 141 | long timeout)</CODE> |
---|
| 142 | |
---|
| 143 | <BR> |
---|
| 144 | Create a new ouput stream with the given timeout.</TD> |
---|
| 145 | </TR> |
---|
| 146 | </TABLE> |
---|
| 147 | |
---|
| 148 | <!-- ========== METHOD SUMMARY =========== --> |
---|
| 149 | |
---|
| 150 | <A NAME="method_summary"><!-- --></A> |
---|
| 151 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 152 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 153 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 154 | <B>Method Summary</B></FONT></TH> |
---|
| 155 | </TR> |
---|
| 156 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 157 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 158 | <CODE> void</CODE></FONT></TD> |
---|
| 159 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#close()">close</A></B>()</CODE> |
---|
| 160 | |
---|
| 161 | <BR> |
---|
| 162 | </TD> |
---|
| 163 | </TR> |
---|
| 164 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 165 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 166 | <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A></CODE></FONT></TD> |
---|
| 167 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#getChannel()">getChannel</A></B>()</CODE> |
---|
| 168 | |
---|
| 169 | <BR> |
---|
| 170 | Returns underlying channel used by this stream.</TD> |
---|
| 171 | </TR> |
---|
| 172 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 173 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 174 | <CODE> boolean</CODE></FONT></TD> |
---|
| 175 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#isOpen()">isOpen</A></B>()</CODE> |
---|
| 176 | |
---|
| 177 | <BR> |
---|
| 178 | </TD> |
---|
| 179 | </TR> |
---|
| 180 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 181 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 182 | <CODE> void</CODE></FONT></TD> |
---|
| 183 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#transferToFully(java.nio.channels.FileChannel, long, int)">transferToFully</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true" title="class or interface in java.nio.channels">FileChannel</A> fileCh, |
---|
| 184 | long position, |
---|
| 185 | int count)</CODE> |
---|
| 186 | |
---|
| 187 | <BR> |
---|
| 188 | Transfers data from FileChannel using |
---|
| 189 | <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true#transferTo(long, long, java.nio.channels.WritableByteChannel)" title="class or interface in java.nio.channels"><CODE>FileChannel.transferTo(long, long, WritableByteChannel)</CODE></A>.</TD> |
---|
| 190 | </TR> |
---|
| 191 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 192 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 193 | <CODE> void</CODE></FONT></TD> |
---|
| 194 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#waitForWritable()">waitForWritable</A></B>()</CODE> |
---|
| 195 | |
---|
| 196 | <BR> |
---|
| 197 | waits for the underlying channel to be ready for writing.</TD> |
---|
| 198 | </TR> |
---|
| 199 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 200 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 201 | <CODE> void</CODE></FONT></TD> |
---|
| 202 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#write(byte[], int, int)">write</A></B>(byte[] b, |
---|
| 203 | int off, |
---|
| 204 | int len)</CODE> |
---|
| 205 | |
---|
| 206 | <BR> |
---|
| 207 | </TD> |
---|
| 208 | </TR> |
---|
| 209 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 210 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 211 | <CODE> int</CODE></FONT></TD> |
---|
| 212 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#write(java.nio.ByteBuffer)">write</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> src)</CODE> |
---|
| 213 | |
---|
| 214 | <BR> |
---|
| 215 | </TD> |
---|
| 216 | </TR> |
---|
| 217 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 218 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 219 | <CODE> void</CODE></FONT></TD> |
---|
| 220 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/net/SocketOutputStream.html#write(int)">write</A></B>(int b)</CODE> |
---|
| 221 | |
---|
| 222 | <BR> |
---|
| 223 | </TD> |
---|
| 224 | </TR> |
---|
| 225 | </TABLE> |
---|
| 226 | <A NAME="methods_inherited_from_class_java.io.OutputStream"><!-- --></A> |
---|
| 227 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 228 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
| 229 | <TH ALIGN="left"><B>Methods inherited from class java.io.<A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></B></TH> |
---|
| 230 | </TR> |
---|
| 231 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 232 | <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#flush()" title="class or interface in java.io">flush</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#write(byte[])" title="class or interface in java.io">write</A></CODE></TD> |
---|
| 233 | </TR> |
---|
| 234 | </TABLE> |
---|
| 235 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
| 236 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 237 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
| 238 | <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> |
---|
| 239 | </TR> |
---|
| 240 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 241 | <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> |
---|
| 242 | </TR> |
---|
| 243 | </TABLE> |
---|
| 244 | |
---|
| 245 | <P> |
---|
| 246 | |
---|
| 247 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
| 248 | |
---|
| 249 | <A NAME="constructor_detail"><!-- --></A> |
---|
| 250 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 251 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 252 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 253 | <B>Constructor Detail</B></FONT></TH> |
---|
| 254 | </TR> |
---|
| 255 | </TABLE> |
---|
| 256 | |
---|
| 257 | <A NAME="SocketOutputStream(java.nio.channels.WritableByteChannel, long)"><!-- --></A><H3> |
---|
| 258 | SocketOutputStream</H3> |
---|
| 259 | <PRE> |
---|
| 260 | public <B>SocketOutputStream</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A> channel, |
---|
| 261 | long timeout) |
---|
| 262 | 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> |
---|
| 263 | <DL> |
---|
| 264 | <DD>Create a new ouput stream with the given timeout. If the timeout |
---|
| 265 | is zero, it will be treated as infinite timeout. The socket's |
---|
| 266 | channel will be configured to be non-blocking. |
---|
| 267 | <P> |
---|
| 268 | <DL> |
---|
| 269 | <DT><B>Parameters:</B><DD><CODE>channel</CODE> - Channel for writing, 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>. |
---|
| 270 | The channel will be configured to be non-blocking.<DD><CODE>timeout</CODE> - timeout in milliseconds. must not be negative. |
---|
| 271 | <DT><B>Throws:</B> |
---|
| 272 | <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> |
---|
| 273 | </DL> |
---|
| 274 | <HR> |
---|
| 275 | |
---|
| 276 | <A NAME="SocketOutputStream(java.net.Socket, long)"><!-- --></A><H3> |
---|
| 277 | SocketOutputStream</H3> |
---|
| 278 | <PRE> |
---|
| 279 | public <B>SocketOutputStream</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> socket, |
---|
| 280 | long timeout) |
---|
| 281 | 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> |
---|
| 282 | <DL> |
---|
| 283 | <DD>Same as SocketOutputStream(socket.getChannel(), timeout):<br><br> |
---|
| 284 | |
---|
| 285 | Create a new ouput stream with the given timeout. If the timeout |
---|
| 286 | is zero, it will be treated as infinite timeout. The socket's |
---|
| 287 | channel will be configured to be non-blocking. |
---|
| 288 | <P> |
---|
| 289 | <DL> |
---|
| 290 | <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. |
---|
| 291 | <DT><B>Throws:</B> |
---|
| 292 | <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/SocketOutputStream.html#SocketOutputStream(java.nio.channels.WritableByteChannel, long)"><CODE>SocketOutputStream(WritableByteChannel, long)</CODE></A></DL> |
---|
| 293 | </DL> |
---|
| 294 | |
---|
| 295 | <!-- ============ METHOD DETAIL ========== --> |
---|
| 296 | |
---|
| 297 | <A NAME="method_detail"><!-- --></A> |
---|
| 298 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 299 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 300 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 301 | <B>Method Detail</B></FONT></TH> |
---|
| 302 | </TR> |
---|
| 303 | </TABLE> |
---|
| 304 | |
---|
| 305 | <A NAME="write(int)"><!-- --></A><H3> |
---|
| 306 | write</H3> |
---|
| 307 | <PRE> |
---|
| 308 | public void <B>write</B>(int b) |
---|
| 309 | 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> |
---|
| 310 | <DL> |
---|
| 311 | <DD><DL> |
---|
| 312 | <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#write(int)" title="class or interface in java.io">write</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL> |
---|
| 313 | </DD> |
---|
| 314 | <DD><DL> |
---|
| 315 | |
---|
| 316 | <DT><B>Throws:</B> |
---|
| 317 | <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> |
---|
| 318 | </DD> |
---|
| 319 | </DL> |
---|
| 320 | <HR> |
---|
| 321 | |
---|
| 322 | <A NAME="write(byte[], int, int)"><!-- --></A><H3> |
---|
| 323 | write</H3> |
---|
| 324 | <PRE> |
---|
| 325 | public void <B>write</B>(byte[] b, |
---|
| 326 | int off, |
---|
| 327 | int len) |
---|
| 328 | 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> |
---|
| 329 | <DL> |
---|
| 330 | <DD><DL> |
---|
| 331 | <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#write(byte[], int, int)" title="class or interface in java.io">write</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL> |
---|
| 332 | </DD> |
---|
| 333 | <DD><DL> |
---|
| 334 | |
---|
| 335 | <DT><B>Throws:</B> |
---|
| 336 | <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> |
---|
| 337 | </DD> |
---|
| 338 | </DL> |
---|
| 339 | <HR> |
---|
| 340 | |
---|
| 341 | <A NAME="close()"><!-- --></A><H3> |
---|
| 342 | close</H3> |
---|
| 343 | <PRE> |
---|
| 344 | public void <B>close</B>() |
---|
| 345 | 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> |
---|
| 346 | <DL> |
---|
| 347 | <DD><DL> |
---|
| 348 | <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/OutputStream.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/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL> |
---|
| 349 | </DD> |
---|
| 350 | <DD><DL> |
---|
| 351 | |
---|
| 352 | <DT><B>Throws:</B> |
---|
| 353 | <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> |
---|
| 354 | </DD> |
---|
| 355 | </DL> |
---|
| 356 | <HR> |
---|
| 357 | |
---|
| 358 | <A NAME="getChannel()"><!-- --></A><H3> |
---|
| 359 | getChannel</H3> |
---|
| 360 | <PRE> |
---|
| 361 | public <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A> <B>getChannel</B>()</PRE> |
---|
| 362 | <DL> |
---|
| 363 | <DD>Returns underlying channel used by this stream. |
---|
| 364 | This is useful in certain cases like channel for |
---|
| 365 | <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true#transferTo(long, long, java.nio.channels.WritableByteChannel)" title="class or interface in java.nio.channels"><CODE>FileChannel.transferTo(long, long, WritableByteChannel)</CODE></A> |
---|
| 366 | <P> |
---|
| 367 | <DD><DL> |
---|
| 368 | </DL> |
---|
| 369 | </DD> |
---|
| 370 | <DD><DL> |
---|
| 371 | </DL> |
---|
| 372 | </DD> |
---|
| 373 | </DL> |
---|
| 374 | <HR> |
---|
| 375 | |
---|
| 376 | <A NAME="isOpen()"><!-- --></A><H3> |
---|
| 377 | isOpen</H3> |
---|
| 378 | <PRE> |
---|
| 379 | public boolean <B>isOpen</B>()</PRE> |
---|
| 380 | <DL> |
---|
| 381 | <DD><DL> |
---|
| 382 | <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> |
---|
| 383 | </DD> |
---|
| 384 | <DD><DL> |
---|
| 385 | </DL> |
---|
| 386 | </DD> |
---|
| 387 | </DL> |
---|
| 388 | <HR> |
---|
| 389 | |
---|
| 390 | <A NAME="write(java.nio.ByteBuffer)"><!-- --></A><H3> |
---|
| 391 | write</H3> |
---|
| 392 | <PRE> |
---|
| 393 | public int <B>write</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> src) |
---|
| 394 | 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> |
---|
| 395 | <DL> |
---|
| 396 | <DD><DL> |
---|
| 397 | <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true#write(java.nio.ByteBuffer)" title="class or interface in java.nio.channels">write</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html?is-external=true" title="class or interface in java.nio.channels">WritableByteChannel</A></CODE></DL> |
---|
| 398 | </DD> |
---|
| 399 | <DD><DL> |
---|
| 400 | |
---|
| 401 | <DT><B>Throws:</B> |
---|
| 402 | <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> |
---|
| 403 | </DD> |
---|
| 404 | </DL> |
---|
| 405 | <HR> |
---|
| 406 | |
---|
| 407 | <A NAME="waitForWritable()"><!-- --></A><H3> |
---|
| 408 | waitForWritable</H3> |
---|
| 409 | <PRE> |
---|
| 410 | public void <B>waitForWritable</B>() |
---|
| 411 | 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> |
---|
| 412 | <DL> |
---|
| 413 | <DD>waits for the underlying channel to be ready for writing. |
---|
| 414 | The timeout specified for this stream applies to this wait. |
---|
| 415 | <P> |
---|
| 416 | <DD><DL> |
---|
| 417 | </DL> |
---|
| 418 | </DD> |
---|
| 419 | <DD><DL> |
---|
| 420 | |
---|
| 421 | <DT><B>Throws:</B> |
---|
| 422 | <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. |
---|
| 423 | <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> |
---|
| 424 | </DD> |
---|
| 425 | </DL> |
---|
| 426 | <HR> |
---|
| 427 | |
---|
| 428 | <A NAME="transferToFully(java.nio.channels.FileChannel, long, int)"><!-- --></A><H3> |
---|
| 429 | transferToFully</H3> |
---|
| 430 | <PRE> |
---|
| 431 | public void <B>transferToFully</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true" title="class or interface in java.nio.channels">FileChannel</A> fileCh, |
---|
| 432 | long position, |
---|
| 433 | int count) |
---|
| 434 | 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> |
---|
| 435 | <DL> |
---|
| 436 | <DD>Transfers data from FileChannel using |
---|
| 437 | <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true#transferTo(long, long, java.nio.channels.WritableByteChannel)" title="class or interface in java.nio.channels"><CODE>FileChannel.transferTo(long, long, WritableByteChannel)</CODE></A>. |
---|
| 438 | |
---|
| 439 | Similar to readFully(), this waits till requested amount of |
---|
| 440 | data is transfered. |
---|
| 441 | <P> |
---|
| 442 | <DD><DL> |
---|
| 443 | </DL> |
---|
| 444 | </DD> |
---|
| 445 | <DD><DL> |
---|
| 446 | <DT><B>Parameters:</B><DD><CODE>fileCh</CODE> - FileChannel to transfer data from.<DD><CODE>position</CODE> - position within the channel where the transfer begins<DD><CODE>count</CODE> - number of bytes to transfer. |
---|
| 447 | <DT><B>Throws:</B> |
---|
| 448 | <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/EOFException.html?is-external=true" title="class or interface in java.io">EOFException</A></CODE> - If end of input file is reached before requested number of |
---|
| 449 | bytes are transfered. |
---|
| 450 | <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 this channel blocks transfer longer than timeout for |
---|
| 451 | this stream. |
---|
| 452 | <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> - Includes any exception thrown by |
---|
| 453 | <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html?is-external=true#transferTo(long, long, java.nio.channels.WritableByteChannel)" title="class or interface in java.nio.channels"><CODE>FileChannel.transferTo(long, long, WritableByteChannel)</CODE></A>.</DL> |
---|
| 454 | </DD> |
---|
| 455 | </DL> |
---|
| 456 | <!-- ========= END OF CLASS DATA ========= --> |
---|
| 457 | <HR> |
---|
| 458 | |
---|
| 459 | |
---|
| 460 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
| 461 | <A NAME="navbar_bottom"><!-- --></A> |
---|
| 462 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
| 463 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
| 464 | <TR> |
---|
| 465 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
| 466 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
| 467 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
| 468 | <TR ALIGN="center" VALIGN="top"> |
---|
| 469 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
| 470 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
| 471 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
| 472 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SocketOutputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
| 473 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
| 474 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
| 475 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
| 476 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
| 477 | </TR> |
---|
| 478 | </TABLE> |
---|
| 479 | </TD> |
---|
| 480 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
| 481 | </EM> |
---|
| 482 | </TD> |
---|
| 483 | </TR> |
---|
| 484 | |
---|
| 485 | <TR> |
---|
| 486 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 487 | <A HREF="../../../../org/apache/hadoop/net/SocketInputStream.html" title="class in org.apache.hadoop.net"><B>PREV CLASS</B></A> |
---|
| 488 | <A HREF="../../../../org/apache/hadoop/net/SocksSocketFactory.html" title="class in org.apache.hadoop.net"><B>NEXT CLASS</B></A></FONT></TD> |
---|
| 489 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 490 | <A HREF="../../../../index.html?org/apache/hadoop/net/SocketOutputStream.html" target="_top"><B>FRAMES</B></A> |
---|
| 491 | <A HREF="SocketOutputStream.html" target="_top"><B>NO FRAMES</B></A> |
---|
| 492 | <SCRIPT type="text/javascript"> |
---|
| 493 | <!-- |
---|
| 494 | if(window==top) { |
---|
| 495 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
| 496 | } |
---|
| 497 | //--> |
---|
| 498 | </SCRIPT> |
---|
| 499 | <NOSCRIPT> |
---|
| 500 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
| 501 | </NOSCRIPT> |
---|
| 502 | |
---|
| 503 | |
---|
| 504 | </FONT></TD> |
---|
| 505 | </TR> |
---|
| 506 | <TR> |
---|
| 507 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 508 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 509 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 510 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
| 511 | </TR> |
---|
| 512 | </TABLE> |
---|
| 513 | <A NAME="skip-navbar_bottom"></A> |
---|
| 514 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
| 515 | |
---|
| 516 | <HR> |
---|
| 517 | Copyright © 2009 The Apache Software Foundation |
---|
| 518 | </BODY> |
---|
| 519 | </HTML> |
---|