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-google-internal) on Mon Jan 04 20:47:59 PST 2010 --> 6 <TITLE> 7 CharStreams (Guava Libraries 2010.01.04) 8 </TITLE> 9 10 <META NAME="date" CONTENT="2010-01-04"> 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="CharStreams (Guava Libraries 2010.01.04)"; 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/CharStreams.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="../../../../com/google/common/io/ByteStreams.html" title="class in com.google.common.io"><B>PREV CLASS</B></A> 59 <A HREF="../../../../com/google/common/io/Closeables.html" title="class in com.google.common.io"><B>NEXT CLASS</B></A></FONT></TD> 60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 61 <A HREF="../../../../index.html?com/google/common/io/CharStreams.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="CharStreams.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 | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81 DETAIL: FIELD | CONSTR | <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 com.google.common.io</FONT> 92 <BR> 93 Class CharStreams</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 "><B>com.google.common.io.CharStreams</B> 97 </PRE> 98 <HR> 99 <DL> 100 <DT><PRE>public final class <B>CharStreams</B><DT>extends <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></DL> 101 </PRE> 102 103 <P> 104 Provides utility methods for working with character streams. 105 106 <p>All method parameters must be non-null unless documented otherwise. 107 108 <p>Some of the methods in this class take arguments with a generic type of 109 <code>Readable & Closeable</code>. A <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io"><CODE>Reader</CODE></A> implements both of 110 those interfaces. Similarly for <code>Appendable & Closeable</code> and 111 <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io"><CODE>Writer</CODE></A>. 112 <P> 113 114 <P> 115 <DL> 116 <DT><B>Since:</B></DT> 117 <DD>2009.09.15 <b>tentative</b></DD> 118 <DT><B>Author:</B></DT> 119 <DD>Chris Nokleberg, Bin Zhu</DD> 120 </DL> 121 <HR> 122 123 <P> 124 125 <!-- ========== METHOD SUMMARY =========== --> 126 127 <A NAME="method_summary"><!-- --></A> 128 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 129 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 130 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 131 <B>Method Summary</B></FONT></TH> 132 </TR> 133 <TR BGCOLOR="white" CLASS="TableRowColor"> 134 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 135 <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A></CODE></FONT></TD> 136 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#asWriter(java.lang.Appendable)">asWriter</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> target)</CODE> 137 138 <BR> 139 Returns a Writer that sends all output to the given <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> 140 target.</TD> 141 </TR> 142 <TR BGCOLOR="white" CLASS="TableRowColor"> 143 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 144 <CODE>static 145 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 146 <TR ALIGN="right" VALIGN=""> 147 <TD NOWRAP><FONT SIZE="-1"> 148 <CODE><R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>> 149 <BR> 150 long</CODE></FONT></TD> 151 </TR> 152 </TABLE> 153 </CODE></FONT></TD> 154 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#copy(com.google.common.io.InputSupplier, java.lang.Appendable)">copy</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> from, 155 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> to)</CODE> 156 157 <BR> 158 Opens a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> object from the supplier, copies all characters 159 to the <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> object, and closes the input.</TD> 160 </TR> 161 <TR BGCOLOR="white" CLASS="TableRowColor"> 162 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 163 <CODE>static 164 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 165 <TR ALIGN="right" VALIGN=""> 166 <TD NOWRAP><FONT SIZE="-1"> 167 <CODE><R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>,W extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> & <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>> 168 <BR> 169 long</CODE></FONT></TD> 170 </TR> 171 </TABLE> 172 </CODE></FONT></TD> 173 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#copy(com.google.common.io.InputSupplier, com.google.common.io.OutputSupplier)">copy</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> from, 174 <A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><W> to)</CODE> 175 176 <BR> 177 Opens <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> and <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> objects from the 178 given factories, copies all characters between the two, and closes 179 them.</TD> 180 </TR> 181 <TR BGCOLOR="white" CLASS="TableRowColor"> 182 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 183 <CODE>static long</CODE></FONT></TD> 184 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#copy(java.lang.Readable, java.lang.Appendable)">copy</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> from, 185 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> to)</CODE> 186 187 <BR> 188 Copies all characters between the <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> and <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> 189 objects.</TD> 190 </TR> 191 <TR BGCOLOR="white" CLASS="TableRowColor"> 192 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 193 <CODE>static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>></CODE></FONT></TD> 194 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#join(com.google.common.io.InputSupplier...)">join</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>>... suppliers)</CODE> 195 196 <BR> 197 Varargs form of <A HREF="../../../../com/google/common/io/CharStreams.html#join(java.lang.Iterable)"><CODE>join(Iterable)</CODE></A>.</TD> 198 </TR> 199 <TR BGCOLOR="white" CLASS="TableRowColor"> 200 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 201 <CODE>static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>></CODE></FONT></TD> 202 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#join(java.lang.Iterable)">join</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><? extends <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>>> suppliers)</CODE> 203 204 <BR> 205 Joins multiple <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io"><CODE>Reader</CODE></A> suppliers into a single supplier.</TD> 206 </TR> 207 <TR BGCOLOR="white" CLASS="TableRowColor"> 208 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 209 <CODE>static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStreamReader.html?is-external=true" title="class or interface in java.io">InputStreamReader</A>></CODE></FONT></TD> 210 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#newReaderSupplier(com.google.common.io.InputSupplier, java.nio.charset.Charset)">newReaderSupplier</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><? 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>> in, 211 <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</A> charset)</CODE> 212 213 <BR> 214 Returns a factory that will supply instances of <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStreamReader.html?is-external=true" title="class or interface in java.io"><CODE>InputStreamReader</CODE></A>, 215 using the given <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><CODE>InputStream</CODE></A> factory and character set.</TD> 216 </TR> 217 <TR BGCOLOR="white" CLASS="TableRowColor"> 218 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 219 <CODE>static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/StringReader.html?is-external=true" title="class or interface in java.io">StringReader</A>></CODE></FONT></TD> 220 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#newReaderSupplier(java.lang.String)">newReaderSupplier</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</CODE> 221 222 <BR> 223 Returns a factory that will supply instances of <A HREF="http://java.sun.com/javase/6/docs/api/java/io/StringReader.html?is-external=true" title="class or interface in java.io"><CODE>StringReader</CODE></A> that 224 read a string value.</TD> 225 </TR> 226 <TR BGCOLOR="white" CLASS="TableRowColor"> 227 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 228 <CODE>static <A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStreamWriter.html?is-external=true" title="class or interface in java.io">OutputStreamWriter</A>></CODE></FONT></TD> 229 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#newWriterSupplier(com.google.common.io.OutputSupplier, java.nio.charset.Charset)">newWriterSupplier</A></B>(<A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><? 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>> out, 230 <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</A> charset)</CODE> 231 232 <BR> 233 Returns a factory that will supply instances of <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStreamWriter.html?is-external=true" title="class or interface in java.io"><CODE>OutputStreamWriter</CODE></A>, 234 using the given <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><CODE>OutputStream</CODE></A> factory and character set.</TD> 235 </TR> 236 <TR BGCOLOR="white" CLASS="TableRowColor"> 237 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 238 <CODE>static 239 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 240 <TR ALIGN="right" VALIGN=""> 241 <TD NOWRAP><FONT SIZE="-1"> 242 <CODE><R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>> 243 <BR> 244 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> 245 </TR> 246 </TABLE> 247 </CODE></FONT></TD> 248 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#readFirstLine(com.google.common.io.InputSupplier)">readFirstLine</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier)</CODE> 249 250 <BR> 251 Reads the first line from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> & <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 252 supplied by a factory.</TD> 253 </TR> 254 <TR BGCOLOR="white" CLASS="TableRowColor"> 255 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 256 <CODE>static 257 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 258 <TR ALIGN="right" VALIGN=""> 259 <TD NOWRAP><FONT SIZE="-1"> 260 <CODE><R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>> 261 <BR> 262 <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>></CODE></FONT></TD> 263 </TR> 264 </TABLE> 265 </CODE></FONT></TD> 266 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#readLines(com.google.common.io.InputSupplier)">readLines</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier)</CODE> 267 268 <BR> 269 Reads all of the lines from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> & <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 270 supplied by a factory.</TD> 271 </TR> 272 <TR BGCOLOR="white" CLASS="TableRowColor"> 273 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 274 <CODE>static 275 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 276 <TR ALIGN="right" VALIGN=""> 277 <TD NOWRAP><FONT SIZE="-1"> 278 <CODE><R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>,T> 279 <BR> 280 T</CODE></FONT></TD> 281 </TR> 282 </TABLE> 283 </CODE></FONT></TD> 284 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#readLines(com.google.common.io.InputSupplier, com.google.common.io.LineProcessor)">readLines</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier, 285 <A HREF="../../../../com/google/common/io/LineProcessor.html" title="interface in com.google.common.io">LineProcessor</A><T> callback)</CODE> 286 287 <BR> 288 Streams lines from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> and <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 289 supplied by a factory, stopping when our callback returns false, or we 290 have read all of the lines.</TD> 291 </TR> 292 <TR BGCOLOR="white" CLASS="TableRowColor"> 293 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 294 <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>></CODE></FONT></TD> 295 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#readLines(java.lang.Readable)">readLines</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> r)</CODE> 296 297 <BR> 298 Reads all of the lines from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> object.</TD> 299 </TR> 300 <TR BGCOLOR="white" CLASS="TableRowColor"> 301 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 302 <CODE>static void</CODE></FONT></TD> 303 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#skipFully(java.io.Reader, long)">skipFully</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> reader, 304 long n)</CODE> 305 306 <BR> 307 Discards <code>n</code> characters of data from the reader.</TD> 308 </TR> 309 <TR BGCOLOR="white" CLASS="TableRowColor"> 310 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 311 <CODE>static 312 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 313 <TR ALIGN="right" VALIGN=""> 314 <TD NOWRAP><FONT SIZE="-1"> 315 <CODE><R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>> 316 <BR> 317 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> 318 </TR> 319 </TABLE> 320 </CODE></FONT></TD> 321 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#toString(com.google.common.io.InputSupplier)">toString</A></B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier)</CODE> 322 323 <BR> 324 Returns the characters from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> & <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 325 supplied by a factory as a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A>.</TD> 326 </TR> 327 <TR BGCOLOR="white" CLASS="TableRowColor"> 328 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 329 <CODE>static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> 330 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#toString(java.lang.Readable)">toString</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> r)</CODE> 331 332 <BR> 333 Reads all characters from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> object into a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A>.</TD> 334 </TR> 335 <TR BGCOLOR="white" CLASS="TableRowColor"> 336 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 337 <CODE>static 338 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> 339 <TR ALIGN="right" VALIGN=""> 340 <TD NOWRAP><FONT SIZE="-1"> 341 <CODE><W extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> & <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>> 342 <BR> 343 void</CODE></FONT></TD> 344 </TR> 345 </TABLE> 346 </CODE></FONT></TD> 347 <TD><CODE><B><A HREF="../../../../com/google/common/io/CharStreams.html#write(java.lang.CharSequence, com.google.common.io.OutputSupplier)">write</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</A> from, 348 <A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><W> to)</CODE> 349 350 <BR> 351 Writes a character sequence (such as a string) to an appendable 352 object from the given supplier.</TD> 353 </TR> 354 </TABLE> 355 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 356 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 357 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 358 <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> 359 </TR> 360 <TR BGCOLOR="white" CLASS="TableRowColor"> 361 <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> 362 </TR> 363 </TABLE> 364 365 <P> 366 367 <!-- ============ METHOD DETAIL ========== --> 368 369 <A NAME="method_detail"><!-- --></A> 370 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 371 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 372 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 373 <B>Method Detail</B></FONT></TH> 374 </TR> 375 </TABLE> 376 377 <A NAME="newReaderSupplier(java.lang.String)"><!-- --></A><H3> 378 newReaderSupplier</H3> 379 <PRE> 380 public static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/StringReader.html?is-external=true" title="class or interface in java.io">StringReader</A>> <B>newReaderSupplier</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> value)</PRE> 381 <DL> 382 <DD>Returns a factory that will supply instances of <A HREF="http://java.sun.com/javase/6/docs/api/java/io/StringReader.html?is-external=true" title="class or interface in java.io"><CODE>StringReader</CODE></A> that 383 read a string value. 384 <P> 385 <DD><DL> 386 <DT><B>Parameters:</B><DD><CODE>value</CODE> - the string to read 387 <DT><B>Returns:</B><DD>the factory</DL> 388 </DD> 389 </DL> 390 <HR> 391 392 <A NAME="newReaderSupplier(com.google.common.io.InputSupplier, java.nio.charset.Charset)"><!-- --></A><H3> 393 newReaderSupplier</H3> 394 <PRE> 395 public static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStreamReader.html?is-external=true" title="class or interface in java.io">InputStreamReader</A>> <B>newReaderSupplier</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><? 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>> in, 396 <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</A> charset)</PRE> 397 <DL> 398 <DD>Returns a factory that will supply instances of <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStreamReader.html?is-external=true" title="class or interface in java.io"><CODE>InputStreamReader</CODE></A>, 399 using the given <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><CODE>InputStream</CODE></A> factory and character set. 400 <P> 401 <DD><DL> 402 <DT><B>Parameters:</B><DD><CODE>in</CODE> - the factory that will be used to open input streams<DD><CODE>charset</CODE> - the character set used to decode the input stream 403 <DT><B>Returns:</B><DD>the factory</DL> 404 </DD> 405 </DL> 406 <HR> 407 408 <A NAME="newWriterSupplier(com.google.common.io.OutputSupplier, java.nio.charset.Charset)"><!-- --></A><H3> 409 newWriterSupplier</H3> 410 <PRE> 411 public static <A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStreamWriter.html?is-external=true" title="class or interface in java.io">OutputStreamWriter</A>> <B>newWriterSupplier</B>(<A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><? 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>> out, 412 <A HREF="http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html?is-external=true" title="class or interface in java.nio.charset">Charset</A> charset)</PRE> 413 <DL> 414 <DD>Returns a factory that will supply instances of <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStreamWriter.html?is-external=true" title="class or interface in java.io"><CODE>OutputStreamWriter</CODE></A>, 415 using the given <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><CODE>OutputStream</CODE></A> factory and character set. 416 <P> 417 <DD><DL> 418 <DT><B>Parameters:</B><DD><CODE>out</CODE> - the factory that will be used to open output streams<DD><CODE>charset</CODE> - the character set used to encode the output stream 419 <DT><B>Returns:</B><DD>the factory</DL> 420 </DD> 421 </DL> 422 <HR> 423 424 <A NAME="write(java.lang.CharSequence, com.google.common.io.OutputSupplier)"><!-- --></A><H3> 425 write</H3> 426 <PRE> 427 public static <W extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> & <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>> void <B>write</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</A> from, 428 <A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><W> to) 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>Writes a character sequence (such as a string) to an appendable 432 object from the given supplier. 433 <P> 434 <DD><DL> 435 <DT><B>Parameters:</B><DD><CODE>from</CODE> - the character sequence to write<DD><CODE>to</CODE> - the output supplier 436 <DT><B>Throws:</B> 437 <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 an I/O error occurs</DL> 438 </DD> 439 </DL> 440 <HR> 441 442 <A NAME="copy(com.google.common.io.InputSupplier, com.google.common.io.OutputSupplier)"><!-- --></A><H3> 443 copy</H3> 444 <PRE> 445 public static <R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>,W extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> & <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>> long <B>copy</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> from, 446 <A HREF="../../../../com/google/common/io/OutputSupplier.html" title="interface in com.google.common.io">OutputSupplier</A><W> to) 447 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> 448 <DL> 449 <DD>Opens <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> and <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> objects from the 450 given factories, copies all characters between the two, and closes 451 them. 452 <P> 453 <DD><DL> 454 <DT><B>Parameters:</B><DD><CODE>from</CODE> - the input factory<DD><CODE>to</CODE> - the output factory 455 <DT><B>Returns:</B><DD>the number of characters copied 456 <DT><B>Throws:</B> 457 <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 an I/O error occurs</DL> 458 </DD> 459 </DL> 460 <HR> 461 462 <A NAME="copy(com.google.common.io.InputSupplier, java.lang.Appendable)"><!-- --></A><H3> 463 copy</H3> 464 <PRE> 465 public static <R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>> long <B>copy</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> from, 466 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> to) 467 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> 468 <DL> 469 <DD>Opens a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> object from the supplier, copies all characters 470 to the <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> object, and closes the input. Does not close 471 or flush the output. 472 <P> 473 <DD><DL> 474 <DT><B>Parameters:</B><DD><CODE>from</CODE> - the input factory<DD><CODE>to</CODE> - the object to write to 475 <DT><B>Returns:</B><DD>the number of characters copied 476 <DT><B>Throws:</B> 477 <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 an I/O error occurs</DL> 478 </DD> 479 </DL> 480 <HR> 481 482 <A NAME="copy(java.lang.Readable, java.lang.Appendable)"><!-- --></A><H3> 483 copy</H3> 484 <PRE> 485 public static long <B>copy</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> from, 486 <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> to) 487 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> 488 <DL> 489 <DD>Copies all characters between the <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> and <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> 490 objects. Does not close or flush either object. 491 <P> 492 <DD><DL> 493 <DT><B>Parameters:</B><DD><CODE>from</CODE> - the object to read from<DD><CODE>to</CODE> - the object to write to 494 <DT><B>Returns:</B><DD>the number of characters copied 495 <DT><B>Throws:</B> 496 <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 an I/O error occurs</DL> 497 </DD> 498 </DL> 499 <HR> 500 501 <A NAME="toString(java.lang.Readable)"><!-- --></A><H3> 502 toString</H3> 503 <PRE> 504 public static <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> r) 505 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> 506 <DL> 507 <DD>Reads all characters from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> object into a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A>. 508 Does not close the <code>Readable</code>. 509 <P> 510 <DD><DL> 511 <DT><B>Parameters:</B><DD><CODE>r</CODE> - the object to read from 512 <DT><B>Returns:</B><DD>a string containing all the characters 513 <DT><B>Throws:</B> 514 <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 an I/O error occurs</DL> 515 </DD> 516 </DL> 517 <HR> 518 519 <A NAME="toString(com.google.common.io.InputSupplier)"><!-- --></A><H3> 520 toString</H3> 521 <PRE> 522 public static <R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier) 523 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> 524 <DL> 525 <DD>Returns the characters from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> & <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 526 supplied by a factory as a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A>. 527 <P> 528 <DD><DL> 529 <DT><B>Parameters:</B><DD><CODE>supplier</CODE> - the factory to read from 530 <DT><B>Returns:</B><DD>a string containing all the characters 531 <DT><B>Throws:</B> 532 <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 an I/O error occurs</DL> 533 </DD> 534 </DL> 535 <HR> 536 537 <A NAME="readFirstLine(com.google.common.io.InputSupplier)"><!-- --></A><H3> 538 readFirstLine</H3> 539 <PRE> 540 public static <R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>readFirstLine</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier) 541 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> 542 <DL> 543 <DD>Reads the first line from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> & <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 544 supplied by a factory. The line does not include line-termination 545 characters, but does include other leading and trailing whitespace. 546 <P> 547 <DD><DL> 548 <DT><B>Parameters:</B><DD><CODE>supplier</CODE> - the factory to read from 549 <DT><B>Returns:</B><DD>the first line, or null if the reader is empty 550 <DT><B>Throws:</B> 551 <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 an I/O error occurs</DL> 552 </DD> 553 </DL> 554 <HR> 555 556 <A NAME="readLines(com.google.common.io.InputSupplier)"><!-- --></A><H3> 557 readLines</H3> 558 <PRE> 559 public static <R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> <B>readLines</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier) 560 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> 561 <DL> 562 <DD>Reads all of the lines from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> & <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 563 supplied by a factory. The lines do not include line-termination 564 characters, but do include other leading and trailing whitespace. 565 <P> 566 <DD><DL> 567 <DT><B>Parameters:</B><DD><CODE>supplier</CODE> - the factory to read from 568 <DT><B>Returns:</B><DD>a mutable <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util"><CODE>List</CODE></A> containing all the lines 569 <DT><B>Throws:</B> 570 <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 an I/O error occurs</DL> 571 </DD> 572 </DL> 573 <HR> 574 575 <A NAME="readLines(java.lang.Readable)"><!-- --></A><H3> 576 readLines</H3> 577 <PRE> 578 public static <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> <B>readLines</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> r) 579 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> 580 <DL> 581 <DD>Reads all of the lines from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> object. The lines do 582 not include line-termination characters, but do include other 583 leading and trailing whitespace. 584 585 <p>Does not close the <code>Readable</code>. If reading files or resources you 586 should use the <A HREF="../../../../com/google/common/io/Files.html#readLines(java.io.File, java.nio.charset.Charset)"><CODE>Files.readLines(java.io.File, java.nio.charset.Charset)</CODE></A> and <A HREF="../../../../com/google/common/io/Resources.html#readLines(java.net.URL, java.nio.charset.Charset, com.google.common.io.LineProcessor)"><CODE>Resources.readLines(java.net.URL, java.nio.charset.Charset, com.google.common.io.LineProcessor<T>)</CODE></A> 587 methods. 588 <P> 589 <DD><DL> 590 <DT><B>Parameters:</B><DD><CODE>r</CODE> - the object to read from 591 <DT><B>Returns:</B><DD>a mutable <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util"><CODE>List</CODE></A> containing all the lines 592 <DT><B>Throws:</B> 593 <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 an I/O error occurs</DL> 594 </DD> 595 </DL> 596 <HR> 597 598 <A NAME="readLines(com.google.common.io.InputSupplier, com.google.common.io.LineProcessor)"><!-- --></A><H3> 599 readLines</H3> 600 <PRE> 601 public static <R extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang">Readable</A> & <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>,T> T <B>readLines</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><R> supplier, 602 <A HREF="../../../../com/google/common/io/LineProcessor.html" title="interface in com.google.common.io">LineProcessor</A><T> callback) 603 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> 604 <DL> 605 <DD>Streams lines from a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Readable.html?is-external=true" title="class or interface in java.lang"><CODE>Readable</CODE></A> and <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A> object 606 supplied by a factory, stopping when our callback returns false, or we 607 have read all of the lines. 608 <P> 609 <DD><DL> 610 <DT><B>Parameters:</B><DD><CODE>supplier</CODE> - the factory to read from<DD><CODE>callback</CODE> - the LineProcessor to use to handle the lines 611 <DT><B>Returns:</B><DD>the output of processing the lines 612 <DT><B>Throws:</B> 613 <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 an I/O error occurs</DL> 614 </DD> 615 </DL> 616 <HR> 617 618 <A NAME="join(java.lang.Iterable)"><!-- --></A><H3> 619 join</H3> 620 <PRE> 621 public static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>> <B>join</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><? extends <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>>> suppliers)</PRE> 622 <DL> 623 <DD>Joins multiple <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io"><CODE>Reader</CODE></A> suppliers into a single supplier. 624 Reader returned from the supplier will contain the concatenated data 625 from the readers of the underlying suppliers. 626 627 <p>Reading from the joined reader will throw a <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang"><CODE>NullPointerException</CODE></A> 628 if any of the suppliers are null or return null. 629 630 <p>Only one underlying reader will be open at a time. Closing the 631 joined reader will close the open underlying reader. 632 <P> 633 <DD><DL> 634 <DT><B>Parameters:</B><DD><CODE>suppliers</CODE> - the suppliers to concatenate 635 <DT><B>Returns:</B><DD>a supplier that will return a reader containing the concatenated 636 data</DL> 637 </DD> 638 </DL> 639 <HR> 640 641 <A NAME="join(com.google.common.io.InputSupplier...)"><!-- --></A><H3> 642 join</H3> 643 <PRE> 644 public static <A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>> <B>join</B>(<A HREF="../../../../com/google/common/io/InputSupplier.html" title="interface in com.google.common.io">InputSupplier</A><? extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>>... suppliers)</PRE> 645 <DL> 646 <DD>Varargs form of <A HREF="../../../../com/google/common/io/CharStreams.html#join(java.lang.Iterable)"><CODE>join(Iterable)</CODE></A>. 647 <P> 648 <DD><DL> 649 </DL> 650 </DD> 651 </DL> 652 <HR> 653 654 <A NAME="skipFully(java.io.Reader, long)"><!-- --></A><H3> 655 skipFully</H3> 656 <PRE> 657 public static void <B>skipFully</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> reader, 658 long n) 659 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> 660 <DL> 661 <DD>Discards <code>n</code> characters of data from the reader. This method 662 will block until the full amount has been skipped. Does not close the 663 reader. 664 <P> 665 <DD><DL> 666 <DT><B>Parameters:</B><DD><CODE>reader</CODE> - the reader to read from<DD><CODE>n</CODE> - the number of characters to skip 667 <DT><B>Throws:</B> 668 <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 this stream reaches the end before skipping all 669 the bytes 670 <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 an I/O error occurs</DL> 671 </DD> 672 </DL> 673 <HR> 674 675 <A NAME="asWriter(java.lang.Appendable)"><!-- --></A><H3> 676 asWriter</H3> 677 <PRE> 678 public static <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A> <B>asWriter</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</A> target)</PRE> 679 <DL> 680 <DD>Returns a Writer that sends all output to the given <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang"><CODE>Appendable</CODE></A> 681 target. Closing the writer will close the target if it is <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io"><CODE>Closeable</CODE></A>, and flushing the writer will flush the target if it is <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io"><CODE>Flushable</CODE></A>. 682 <P> 683 <DD><DL> 684 <DT><B>Parameters:</B><DD><CODE>target</CODE> - the object to which output will be sent 685 <DT><B>Returns:</B><DD>a new Writer object, unless target is a Writer, in which case the 686 target is returned</DL> 687 </DD> 688 </DL> 689 <!-- ========= END OF CLASS DATA ========= --> 690 <HR> 691 692 693 <!-- ======= START OF BOTTOM NAVBAR ====== --> 694 <A NAME="navbar_bottom"><!-- --></A> 695 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 696 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 697 <TR> 698 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 699 <A NAME="navbar_bottom_firstrow"><!-- --></A> 700 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 701 <TR ALIGN="center" VALIGN="top"> 702 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 703 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 704 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 705 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/CharStreams.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 706 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 707 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 708 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 709 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 710 </TR> 711 </TABLE> 712 </TD> 713 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 714 </EM> 715 </TD> 716 </TR> 717 718 <TR> 719 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 720 <A HREF="../../../../com/google/common/io/ByteStreams.html" title="class in com.google.common.io"><B>PREV CLASS</B></A> 721 <A HREF="../../../../com/google/common/io/Closeables.html" title="class in com.google.common.io"><B>NEXT CLASS</B></A></FONT></TD> 722 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 723 <A HREF="../../../../index.html?com/google/common/io/CharStreams.html" target="_top"><B>FRAMES</B></A> 724 <A HREF="CharStreams.html" target="_top"><B>NO FRAMES</B></A> 725 <SCRIPT type="text/javascript"> 726 <!-- 727 if(window==top) { 728 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 729 } 730 //--> 731 </SCRIPT> 732 <NOSCRIPT> 733 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 734 </NOSCRIPT> 735 736 737 </FONT></TD> 738 </TR> 739 <TR> 740 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 741 SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> 742 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 743 DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> 744 </TR> 745 </TABLE> 746 <A NAME="skip-navbar_bottom"></A> 747 <!-- ======== END OF BOTTOM NAVBAR ======= --> 748 749 <HR> 750 751 </BODY> 752 </HTML> 753