String ext = Util.getExtention(contentType);
final long fileSize = response.getEntity().getContentLength();
- // TODO バッファをもう少し大きくとる?
- final int BUF_SIZE = 1024 * 32;
+ final int BUF_SIZE = 1024 * 512;
BufferedInputStream in = null;
BufferedOutputStream out = null;
File file = new File(downloadFile.toString() + "." + ext);
try {
- in = new BufferedInputStream(response.getEntity().getContent());
+ in = new BufferedInputStream(response.getEntity().getContent(), BUF_SIZE);
logger.info("保存します(" + fileSize / 1024 + "KB): " + file.getPath());
FileOutputStream fos = new FileOutputStream(file);
- out = new BufferedOutputStream(fos);
+ out = new BufferedOutputStream(fos, BUF_SIZE);
long downloadSize = 0;
int i;