Hi,
I just noticed that when one uses Files.readAllBytes() to read for
example from the Linux proc file system, where file size is claimed to
be 0, Files.read() will allocate a buffer of size 0 before then
adjusting in a second loop (arraycopying the zero size buffer)

In my opinion an initial size of 0 should not be used.
I admit this might be a regression for files which are really empty
and return an empty byte array, but I think it is actually more common
to read from files which incorrectly report to be zero sized.

Fabian

Reply via email to