title: Why is java.io.Reader#skip implemented the way that it is?
body: <p>I'm still learning object-oriented programming in Java. I was looking at the Java implementation of <code>java.io.Reader.skip</code> and I'm wondering why exactly it's implemented the way that it is. In particular I have questions about these things that I have noticed:</p>
  
  <ol>
  <li>The buffer used for the <code>skip(long)</code> is a field of the Reader object, rather than a normal variable in the method.</li>
  <li>The maximum buffer length is much less than <code>Integer.MAX_VALUE</code> 2147,483,647. In particular, Java's implementation uses 8192.</li>
  <li><code>java.io.InputStream</code> implements skip the same exact way.</li>
  </ol>
  
  <p>Now, the reasons why I personally think that the buffer is a field, is so that the buffer won't have to be garbage collected repetitively due to being reinitialised repetitively. This might make skipping faster.</p>
  
  <p>The buffer length being smaller I think has to do with making it so that the Reader blocks for shorter periods, but since the Reader is synchronized, would that really make a difference?</p>
  
  <p>Byte streams implementing it the same way, might be for consistency. Are my assumptions correct on these three things?</p>
  
  <p>To summarise, my questions are: About how much of a difference in speed on average does it make to use a field rather than a variable for character arrays? Wouldn't it be just the same to use <code>Integer.MAX_VALUE</code> as the maximum buffer length? And isn't it better and easier to use the no-parameter <code>read</code> method in a for-loop for byte streams since the other <code>read</code> methods just call the no-parameter <code>read</code>?</p>
  
  <p>Sorry if my question's a strange question, but I think that I can learn a lot about object-oriented programming through this question.</p>