Home | History | Annotate | Download | only in io
      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 LineReader (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="LineReader (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>&nbsp;</TD>
     41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
     42   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
     43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/LineReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
     44   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
     45   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
     46   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
     47   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
     48   </TR>
     49 </TABLE>
     50 </TD>
     51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
     52 </EM>
     53 </TD>
     54 </TR>
     55 
     56 <TR>
     57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
     58 &nbsp;<A HREF="../../../../com/google/common/io/LineProcessor.html" title="interface in com.google.common.io"><B>PREV CLASS</B></A>&nbsp;
     59 &nbsp;<A HREF="../../../../com/google/common/io/NullOutputStream.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/LineReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
     62 &nbsp;<A HREF="LineReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
     63 &nbsp;<SCRIPT type="text/javascript">
     64   <!--
     65   if(window==top) {
     66     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
     67   }
     68   //-->
     69 </SCRIPT>
     70 <NOSCRIPT>
     71   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
     72 </NOSCRIPT>
     73 
     74 
     75 </FONT></TD>
     76 </TR>
     77 <TR>
     78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     79   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
     80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
     81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
     82 </TR>
     83 </TABLE>
     84 <A NAME="skip-navbar_top"></A>
     85 <!-- ========= END OF TOP NAVBAR ========= -->
     86 
     87 <HR>
     88 <!-- ======== START OF CLASS DATA ======== -->
     89 <H2>
     90 <FONT SIZE="-1">
     91 com.google.common.io</FONT>
     92 <BR>
     93 Class LineReader</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.LineReader</B>
     97 </PRE>
     98 <HR>
     99 <DL>
    100 <DT><PRE>public final class <B>LineReader</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 A class for reading lines of text. Provides the same functionality
    105  as <A HREF="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html?is-external=true#readLine()" title="class or interface in java.io"><CODE>BufferedReader.readLine()</CODE></A> but for all <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>
    106  objects, not just instances of <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>.
    107 <P>
    108 
    109 <P>
    110 <DL>
    111 <DT><B>Since:</B></DT>
    112   <DD>2009.09.15 <b>tentative</b></DD>
    113 <DT><B>Author:</B></DT>
    114   <DD>Chris Nokleberg</DD>
    115 </DL>
    116 <HR>
    117 
    118 <P>
    119 
    120 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
    121 
    122 <A NAME="constructor_summary"><!-- --></A>
    123 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    124 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    125 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    126 <B>Constructor Summary</B></FONT></TH>
    127 </TR>
    128 <TR BGCOLOR="white" CLASS="TableRowColor">
    129 <TD><CODE><B><A HREF="../../../../com/google/common/io/LineReader.html#LineReader(java.lang.Readable)">LineReader</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>&nbsp;readable)</CODE>
    130 
    131 <BR>
    132 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new instance that will read lines from the given
    133  <code>Readable</code> object.</TD>
    134 </TR>
    135 </TABLE>
    136 &nbsp;
    137 <!-- ========== METHOD SUMMARY =========== -->
    138 
    139 <A NAME="method_summary"><!-- --></A>
    140 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    141 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    142 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    143 <B>Method Summary</B></FONT></TH>
    144 </TR>
    145 <TR BGCOLOR="white" CLASS="TableRowColor">
    146 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    147 <CODE>&nbsp;<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>
    148 <TD><CODE><B><A HREF="../../../../com/google/common/io/LineReader.html#readLine()">readLine</A></B>()</CODE>
    149 
    150 <BR>
    151 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads a line of text.</TD>
    152 </TR>
    153 </TABLE>
    154 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
    155 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    156 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    157 <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>
    158 </TR>
    159 <TR BGCOLOR="white" CLASS="TableRowColor">
    160 <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>
    161 </TR>
    162 </TABLE>
    163 &nbsp;
    164 <P>
    165 
    166 <!-- ========= CONSTRUCTOR DETAIL ======== -->
    167 
    168 <A NAME="constructor_detail"><!-- --></A>
    169 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    170 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    171 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    172 <B>Constructor Detail</B></FONT></TH>
    173 </TR>
    174 </TABLE>
    175 
    176 <A NAME="LineReader(java.lang.Readable)"><!-- --></A><H3>
    177 LineReader</H3>
    178 <PRE>
    179 public <B>LineReader</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>&nbsp;readable)</PRE>
    180 <DL>
    181 <DD>Creates a new instance that will read lines from the given
    182  <code>Readable</code> object.
    183 <P>
    184 </DL>
    185 
    186 <!-- ============ METHOD DETAIL ========== -->
    187 
    188 <A NAME="method_detail"><!-- --></A>
    189 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    190 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    191 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    192 <B>Method Detail</B></FONT></TH>
    193 </TR>
    194 </TABLE>
    195 
    196 <A NAME="readLine()"><!-- --></A><H3>
    197 readLine</H3>
    198 <PRE>
    199 public <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>readLine</B>()
    200                 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>
    201 <DL>
    202 <DD>Reads a line of text. A line is considered to be terminated by any
    203  one of a line feed (<code>'\n'</code>), a carriage return
    204  (<code>'\r'</code>), or a carriage return followed immediately by a linefeed
    205  (<code>"\r\n"</code>).
    206 <P>
    207 <DD><DL>
    208 
    209 <DT><B>Returns:</B><DD>a <code>String</code> containing the contents of the line, not
    210      including any line-termination characters, or <code>null</code> if the
    211      end of the stream has been reached.
    212 <DT><B>Throws:</B>
    213 <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>
    214 </DD>
    215 </DL>
    216 <!-- ========= END OF CLASS DATA ========= -->
    217 <HR>
    218 
    219 
    220 <!-- ======= START OF BOTTOM NAVBAR ====== -->
    221 <A NAME="navbar_bottom"><!-- --></A>
    222 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
    223 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
    224 <TR>
    225 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    226 <A NAME="navbar_bottom_firstrow"><!-- --></A>
    227 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
    228   <TR ALIGN="center" VALIGN="top">
    229   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
    230   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    231   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    232   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/LineReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    233   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    234   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    235   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    236   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    237   </TR>
    238 </TABLE>
    239 </TD>
    240 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    241 </EM>
    242 </TD>
    243 </TR>
    244 
    245 <TR>
    246 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    247 &nbsp;<A HREF="../../../../com/google/common/io/LineProcessor.html" title="interface in com.google.common.io"><B>PREV CLASS</B></A>&nbsp;
    248 &nbsp;<A HREF="../../../../com/google/common/io/NullOutputStream.html" title="class in com.google.common.io"><B>NEXT CLASS</B></A></FONT></TD>
    249 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    250   <A HREF="../../../../index.html?com/google/common/io/LineReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
    251 &nbsp;<A HREF="LineReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
    252 &nbsp;<SCRIPT type="text/javascript">
    253   <!--
    254   if(window==top) {
    255     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
    256   }
    257   //-->
    258 </SCRIPT>
    259 <NOSCRIPT>
    260   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
    261 </NOSCRIPT>
    262 
    263 
    264 </FONT></TD>
    265 </TR>
    266 <TR>
    267 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    268   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
    269 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    270 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
    271 </TR>
    272 </TABLE>
    273 <A NAME="skip-navbar_bottom"></A>
    274 <!-- ======== END OF BOTTOM NAVBAR ======= -->
    275 
    276 <HR>
    277 
    278 </BODY>
    279 </HTML>
    280