}
}
}
private void downloadFromHttp(int curIndex){
DownloadableObjects dbo = dObjects[curIndex];
BufferedInputStream in = null;
FileOutputStream fos = null;
BufferedOutputStream bout = null;
progressBar.setVisible(true);
try{
URL url = new URL(dbo.getAddress());
int fileLength = url.openConnection().getContentLength();
int numberOfNeededReads = fileLength/409600; //4096 * 100
int counter = 0;
in = new BufferedInputStream(url.openStream());
fos = new FileOutputStream(saveFolder + dbo.getTitle());
bout = new BufferedOutputStream(fos,1024);
byte[] data = new byte[4096];
int x=0;
while((x=in.read(data,0,4096))>=0){