Skip to content

RemoteFileInputStream does not always return 0 when reading with length 0 #1033

@tilu207

Description

@tilu207

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions