commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/io/src/java/org/apache/commons/io package.html
Date Sat, 24 Apr 2004 23:39:56 GMT
bayard      2004/04/24 16:39:56

  Modified:    io/src/java/org/apache/commons/io package.html
  Log:
  switched the blue colour highlighting to bold text. Blue looks like an anchor. Also made
an attempt at fixing indentation
  
  Revision  Changes    Path
  1.8       +7 -9      jakarta-commons/io/src/java/org/apache/commons/io/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/io/src/java/org/apache/commons/io/package.html,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- package.html	24 Apr 2004 23:36:05 -0000	1.7
  +++ package.html	24 Apr 2004 23:39:56 -0000	1.8
  @@ -46,26 +46,24 @@
   <p>As an example, consider the task of reading bytes from a URL, and printing
   them. This would     typically done like this:</p>
        
  -<pre>import java.net.URL;<br>import java.io.*;<br><br>public class
ManualCopy {<br>  public static void main(String args[]) throws IOException {<br>
   InputStream in = new URL( "http://jakarta.apache.org" ).openStream();<br>    <font
  - color="blue">
  -      InputStreamReader inR = new InputStreamReader( in );
  +<pre>import java.net.URL;<br>import java.io.*;<br><br>public class
ManualCopy {<br>  public static void main(String args[]) throws IOException {<br>
   InputStream in = new URL( "http://jakarta.apache.org" ).openStream();<br>    
  +    <b>InputStreamReader inR = new InputStreamReader( in );
       BufferedReader buf = new BufferedReader( inR );
       String line;
       while ( ( line = buf.readLine() ) != null )
       {
         System.out.println( line );
  -    }
  -    </font>
  -      in.close();
  +    }</b>
  +    in.close();
     }
   }
      </pre>
        
   <p>With the IOUtils class, that could be done with:</p>
        
  -<pre>import java.net.URL;<br>import java.io.*;<br>import org.apache.commons.io.IOUtils;<br><br>public
class IOUtilsCopy {<br>  public static void main(String args[]) throws IOException {<br>
   InputStream in = new URL( "http://jakarta.apache.org" ).openStream();<br>    <font
  - color="blue">System.out.println( IOUtils.toString( in ) );</font>
  -      in.close();
  +<pre>import java.net.URL;<br>import java.io.*;<br>import org.apache.commons.io.IOUtils;<br><br>public
class IOUtilsCopy {<br>  public static void main(String args[]) throws IOException {<br>
   InputStream in = new URL( "http://jakarta.apache.org" ).openStream();<br>    
  +<b>System.out.println( IOUtils.toString( in ) );</b>
  +    in.close();
     }   
   }
       </pre>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message