When reading from the RemoteFileInputStream with length 0 using read(byte[] into, int off, int len), it is not guaranteed to return 0. I recently faced an issue where reading with length 0 actually returned -1, resulting in not all content being read.
According to the InputStream API contract, if length is 0, the method must return 0.
I assume an explicit check for length of 0 is enough - but I am not sure if the underlying read of the RemoteFile should follow the same contract and hence return 0 as well, which would mean there is a bigger issue.
When reading from the
RemoteFileInputStreamwith length 0 usingread(byte[] into, int off, int len), it is not guaranteed to return 0. I recently faced an issue where reading with length 0 actually returned -1, resulting in not all content being read.According to the
InputStreamAPI contract, if length is 0, the method must return 0.I assume an explicit check for length of 0 is enough - but I am not sure if the underlying read of the
RemoteFileshould follow the same contract and hence return 0 as well, which would mean there is a bigger issue.