title: Why it is advisable to wrap a BufferedWriter around any Writer whose write() operations may be costly, such as FileWriters and OutputStreamWriters?
body: <p>My question is, whether it is direct use, as shown below;</p>
  
  <pre><code>class Test{    
  public static void main(String args[]){       
    try{ 
      FileWriter fo =new FileWriter("somex.txt"); 
      int arr[] = {9}; 
      for(int i =0; i &lt;arr.length; i++){
        fo .write(arr[i]); // this is very costly.
      }
      fo.write(b); 
      fo.close(); 
      System.out.println("....");
   }catch(Exception e){system.out.println(e);}     
   } 
  }    
  </code></pre>
  
  <p>OR</p>
  
  <p>coding it more efficient as shown below;</p>
  
  <pre><code>class Test{     
   public static void main(String args[])throws Exception{  
     BufferedWriter bfw= new BufferedWriter(new FileWriter("foo.out")));  
  
     int arr[] = {9};
     for(int i =0; i &lt;arr.length; i++){
        bfw .write(arr[i]); 
      }
  
     bfw.flush();  
     bfw.close();  
  
     System.out.println(".......");  
   }  
  }   
  </code></pre>
  
  <p>There is no difference because both will do same write operation. Can someone help me understand the subtleness?</p>