Option to pre-allocate each download file
|Target version:||JDownloader - FarfarAway|
Because of the fragmentation problems caused by incremental allocation, pre-allocation of each file when it starts to download can often speed a system.
However, this should be optional. The importance of this feature is questionable when downloading parts of an archive, because it is assumed that the archive files will be removed and replaced by the archive contents (those should be preallocated). In addition, this would prevent using file size for error recovery.
Updated by drbits over 2 years ago
Preallocation of files can be done by writing a known test string to a specific position in the file.
0XFEEF is sometimes used.
When writing the buffer to the disk, but not completing the download, writing an end of file code such as ZZYZX will help in eventually being able to find the actual end of file. This even works for multi-chunk downloads.
Finally, with modern hard drives and larger amounts of memory, setting the maximum buffer size to 32MB would not be unreasonable.