I have the following code to download from the internet
URLConnection ucon = url.openConnection();
InputStream is = ucon.getInputStream();
BufferedInputStream inStream = new BufferedInputStream(is, 8192);//this is value one
FileOutputStream outStream = new FileOutputStream(new File(location));
byte[] buff = new byte[8192];//this is value two
int len;
while ((len = inStream.read(buff)) != -1) {
outStream.write(buff, 0, len);
}
My question is what happens if I change the the buffer value : value one and two how does the download speed change ? should they be the same value ? if they are not the same what should each of them indicate ?
I have read the following post :
How do you determine the ideal buffer size when using FileInputStream?
but I did not really understand it . can someone explain it for my please