Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tomaswolf
Copy link
Member

Give the SftpInputStreamAsync a logical file size larger than the current position transfer is requested to start at. If the user calls transferTo(position, count, output), the logical file size for the SftpInputStreamAsync should be (position + count). It's no problem if that is larger than the real file size, it'll just produce an EOF return.

Also guard against NPE in SftpInputStreamAsync in case the initial position is beyond the alleged file size.

Fixes #733.

Give the SftpInputStreamAsync a logical file size larger than the
current position transfer is requested to start at. If the user
calls transferTo(position, count, output), the logical file size for
the SftpInputStreamAsync should be (position + count). It's no problem
if that is larger than the real file size, it'll just produce an EOF
return.

Also guard against NPE in SftpInputStreamAsync in case the initial
position is beyond the alleged file size.
@tomaswolf tomaswolf merged commit b5c3b34 into apache:master Apr 14, 2025
7 checks passed
@tomaswolf tomaswolf deleted the gh-733 branch April 14, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot download file from SFTP in parts - NPE in SftpRemotePathChannel.transferTo (buffer is null)
1 participant