title: Why initialize byte array to 1024 while reading or writing a file?
body: <p>In java input or output stream , there always has a byte array size of 1024.
  Just like below:</p>
  
  <pre><code>        URL url = new URL(src);
          URLConnection connection = url.openConnection();
          InputStream is = connection.getInputStream();
          OutputStream os = new FileOutputStream("D:\\images"+"\\"+getName(src)+getExtension(src)); 
          byte[] byteArray = new byte[1024];
          int len = 0; 
          while((len = is.read(byteArray))!= -1){
              os.write(byteArray, 0, len);
          }
          is.close();
          os.close();
  </code></pre>
  
  <p>Why initialize this array to 1024?</p>