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 ByteProcessor (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="ByteProcessor (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/ByteProcessor.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/ByteArrayDataOutput.html" title="interface in com.google.common.io"><B>PREV CLASS</B></A>&nbsp;
     59 &nbsp;<A HREF="../../../../com/google/common/io/ByteStreams.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/ByteProcessor.html" target="_top"><B>FRAMES</B></A>  &nbsp;
     62 &nbsp;<A HREF="ByteProcessor.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;CONSTR&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;CONSTR&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 Interface ByteProcessor&lt;T&gt;</H2>
     94 <HR>
     95 <DL>
     96 <DT><PRE>public interface <B>ByteProcessor&lt;T&gt;</B></DL>
     97 </PRE>
     98 
     99 <P>
    100 A callback interface to process bytes from a stream.
    101 
    102  <p><A HREF="../../../../com/google/common/io/ByteProcessor.html#processBytes(byte[], int, int)"><CODE>processBytes(byte[], int, int)</CODE></A> will be called for each line that is read, and
    103  should return <code>false</code> when you want to stop processing.
    104 <P>
    105 
    106 <P>
    107 <DL>
    108 <DT><B>Since:</B></DT>
    109   <DD>2009.09.15 <b>tentative</b></DD>
    110 <DT><B>Author:</B></DT>
    111   <DD>Chris Nokleberg</DD>
    112 </DL>
    113 <HR>
    114 
    115 <P>
    116 
    117 <!-- ========== METHOD SUMMARY =========== -->
    118 
    119 <A NAME="method_summary"><!-- --></A>
    120 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    121 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    122 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
    123 <B>Method Summary</B></FONT></TH>
    124 </TR>
    125 <TR BGCOLOR="white" CLASS="TableRowColor">
    126 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    127 <CODE>&nbsp;<A HREF="../../../../com/google/common/io/ByteProcessor.html" title="type parameter in ByteProcessor">T</A></CODE></FONT></TD>
    128 <TD><CODE><B><A HREF="../../../../com/google/common/io/ByteProcessor.html#getResult()">getResult</A></B>()</CODE>
    129 
    130 <BR>
    131 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the result of processing all the bytes.</TD>
    132 </TR>
    133 <TR BGCOLOR="white" CLASS="TableRowColor">
    134 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    135 <CODE>&nbsp;boolean</CODE></FONT></TD>
    136 <TD><CODE><B><A HREF="../../../../com/google/common/io/ByteProcessor.html#processBytes(byte[], int, int)">processBytes</A></B>(byte[]&nbsp;buf,
    137              int&nbsp;off,
    138              int&nbsp;len)</CODE>
    139 
    140 <BR>
    141 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method will be called for each chunk of bytes in an
    142  input stream.</TD>
    143 </TR>
    144 </TABLE>
    145 &nbsp;
    146 <P>
    147 
    148 <!-- ============ METHOD DETAIL ========== -->
    149 
    150 <A NAME="method_detail"><!-- --></A>
    151 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
    152 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    153 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
    154 <B>Method Detail</B></FONT></TH>
    155 </TR>
    156 </TABLE>
    157 
    158 <A NAME="processBytes(byte[], int, int)"><!-- --></A><H3>
    159 processBytes</H3>
    160 <PRE>
    161 boolean <B>processBytes</B>(byte[]&nbsp;buf,
    162                      int&nbsp;off,
    163                      int&nbsp;len)
    164                      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>
    165 <DL>
    166 <DD>This method will be called for each chunk of bytes in an
    167  input stream. The implementation should process the bytes
    168  from <code>buf[off]</code> through <code>buf[off + len - 1]</code>
    169  (inclusive).
    170 <P>
    171 <DD><DL>
    172 <DT><B>Parameters:</B><DD><CODE>buf</CODE> - the byte array containing the data to process<DD><CODE>off</CODE> - the initial offset into the array<DD><CODE>len</CODE> - the length of data to be processed
    173 <DT><B>Returns:</B><DD>true to continue processing, false to stop
    174 <DT><B>Throws:</B>
    175 <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>
    176 </DD>
    177 </DL>
    178 <HR>
    179 
    180 <A NAME="getResult()"><!-- --></A><H3>
    181 getResult</H3>
    182 <PRE>
    183 <A HREF="../../../../com/google/common/io/ByteProcessor.html" title="type parameter in ByteProcessor">T</A> <B>getResult</B>()</PRE>
    184 <DL>
    185 <DD>Return the result of processing all the bytes.
    186 <P>
    187 <DD><DL>
    188 </DL>
    189 </DD>
    190 </DL>
    191 <!-- ========= END OF CLASS DATA ========= -->
    192 <HR>
    193 
    194 
    195 <!-- ======= START OF BOTTOM NAVBAR ====== -->
    196 <A NAME="navbar_bottom"><!-- --></A>
    197 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
    198 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
    199 <TR>
    200 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    201 <A NAME="navbar_bottom_firstrow"><!-- --></A>
    202 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
    203   <TR ALIGN="center" VALIGN="top">
    204   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
    205   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    206   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    207   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteProcessor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    208   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    209   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    210   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    211   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    212   </TR>
    213 </TABLE>
    214 </TD>
    215 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    216 </EM>
    217 </TD>
    218 </TR>
    219 
    220 <TR>
    221 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    222 &nbsp;<A HREF="../../../../com/google/common/io/ByteArrayDataOutput.html" title="interface in com.google.common.io"><B>PREV CLASS</B></A>&nbsp;
    223 &nbsp;<A HREF="../../../../com/google/common/io/ByteStreams.html" title="class in com.google.common.io"><B>NEXT CLASS</B></A></FONT></TD>
    224 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    225   <A HREF="../../../../index.html?com/google/common/io/ByteProcessor.html" target="_top"><B>FRAMES</B></A>  &nbsp;
    226 &nbsp;<A HREF="ByteProcessor.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
    227 &nbsp;<SCRIPT type="text/javascript">
    228   <!--
    229   if(window==top) {
    230     document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
    231   }
    232   //-->
    233 </SCRIPT>
    234 <NOSCRIPT>
    235   <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
    236 </NOSCRIPT>
    237 
    238 
    239 </FONT></TD>
    240 </TR>
    241 <TR>
    242 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    243   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
    244 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    245 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
    246 </TR>
    247 </TABLE>
    248 <A NAME="skip-navbar_bottom"></A>
    249 <!-- ======== END OF BOTTOM NAVBAR ======= -->
    250 
    251 <HR>
    252 
    253 </BODY>
    254 </HTML>
    255