title: What is the buffer size in BufferedReader?
body: <p>What is the sense of buffer size in the constructor?</p>
  
  <pre><code>BufferedReader(Reader in, int size)
  </code></pre>
  
  <p>As i have written the program:</p>
  
  <pre><code>import java.io.*;
  class bufferedReaderEx{
      public static void main(String args[]){
          InputStreamReader isr = null;
          BufferedReader br = null;
              try{
                  isr = new InputStreamReader(System.in);
  //              System.out.println("Write data: ");
  //              int i = isr.read();
  //              System.out.println("Data read is: " + i);
                  //Thus the InputStreamReader is useful for reading the character from the stream
                  System.out.println("Enter the data to be read by the bufferedReader: ");
                  //here isr is containing the lnefeed already so this is needed to be flushed.
                  br = new BufferedReader(isr, 2);
                  String str = br.readLine();
                  System.out.println("The data is : :" +  str);
              }catch(IOException e){
                  System.out.println("Can't read: " + e.getMessage());
              }
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Enter the data to be read by the bufferedReader: Hello world and hello world again
  The data is: Hello world and hello world again
  </code></pre>
  
  <p>Then what does the buffer size means as i intended that it would be reading only two characters. but it was not that.</p>