title: is FileInputStream not buffered and why BufferedInputStream is faster?
body: <p>about the IO, I have two questions.</p>
  <p><strong>A. In a tutorial and some StackOverflow answers, they claimed that <code>FileInputStream</code> is not buffered. is that true ?</strong></p>
  <p><em>The following code use <code>FileInputStream</code> to read data into a byte array(1024 bytes)</em></p>
  <pre><code>class Test {
      public static void main(String[] args) throws IOException {
          FileInputStream fis = new FileInputStream(&quot;./fos.txt&quot;);
          FileOutputStream fos = new FileOutputStream(&quot;./copy.txt&quot;);
  
          byte[] buffer = new byte[1024];   // Is this a buffer ? 
  
          int len;
          while ((len = fis.read(buffer))!= -1) {
              fos.write(buffer);
          }
  
          fos.close();
          fis.close();
      }
  }
  </code></pre>
  <p>From the API, there is one line:</p>
  <blockquote>
  <p>public int read(byte b[]) throws IOException</p>
  <ul>
  <li>@param      b:     the buffer into which the data is read.</li>
  </ul>
  </blockquote>
  <p><strong>B. If they are both buffered, they both put the data into the buffer, and fetch the data from the buffer, where exactly is the place that makes <code>BufferedInputStream</code> faster than <code>FileInputStream</code>?</strong></p>
  <p>Thank you</p>