title: InputStream vs InputStreamReader
body: <p>What's the benefit of using <code>InputStream</code> over <code>InputStreamReader</code>, or vice versa.</p>
  
  <p>Here is an example of <code>InputStream</code> in action:</p>
  
  <pre><code>InputStream input = new FileInputStream("c:\\data\\input-text.txt");
  
  int data = input.read();
  while(data != -1) {
    //do something with data...
    doSomethingWithData(data);
  
    data = input.read();
  }
  input.close();
  </code></pre>
  
  <p>And here is an example of using InputStreamReader (obviously with the help of InputStream):</p>
  
  <pre><code>InputStream inputStream = new FileInputStream("c:\\data\\input.txt");
  Reader      reader      = new InputStreamReader(inputStream);
  
  int data = reader.read();
  while(data != -1){
      char theChar = (char) data;
      data = reader.read();
  }
  
  reader.close();  
  </code></pre>
  
  <p>Does the Reader process the data in a special way?</p>
  
  <p>Just trying to get my head around the whole <code>i/o</code> streaming data aspect in Java.</p>