On Thu, 3 Aug 2023 11:48:39 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> I agree, this should probably be considered as well, as part of a separate 
>> ticket. 
>> 
>> Note that, when the file already exists in the cache, the initial 
>> InputStream object is used by the DigestInputStream, and it is manually 
>> closed and reread again, so special care should be taken here.
>
> Unless we suspect a problem, I don't see a need to do anything differently.

A possible problem is we might reach the maximum of open file handles in the 
underlying OS (I've experienced this before).  I think we should definitely fix 
it (in a separate ticket).

Curiously, the code example for Files.copy(InputStream in, Path target, 
CopyOption... options) does not include closing of input stream, though it has 
some verbiage about promptly closing the input stream in case of an error.    I 
think javadoc there might need to be improved.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1188#discussion_r1294903685

Reply via email to