Downloading files to memory |
You can download a file and store it to memory by using the Sftp#download method that takes a java.io.OutputStream as it's first argument and using a java.io.ByteArrayOutputStream.
Example
// create an ByteArrayOutputStream to store data ByteArrayOutputStream bout = new ByteArrayOutputStream();
// download image.gif file and store in stream sftp.download(bout,"image.gif"); |