Memory leak using while uploading and downloading a file (may be because of using ChannelSftp.get( “file_name”) )?

前端 未结 1 522
天命终不由人
天命终不由人 2021-01-16 01:41

Can you please tell the internal working of ChannelSftp.get( \"file_name\")? Will the use of this function to get a single file from a list of files (600 files

1条回答
  •  礼貌的吻别
    2021-01-16 02:41

    You have to dispose the streams.

    Both the FileInputStream in your upload code and the InputStream returned by ChannelSftp.get in your download code.

    See Disposing streams in Java.

    0 讨论(0)
提交回复
热议问题