code: public SftpFileAttributes get(String remote, OutputStream local,
  			FileTransferProgress progress, long position)
  			throws SftpStatusException, SshException,
  			TransferCancelledException {
  
  		String remotePath = resolveRemotePath(remote);
  		SftpFileAttributes attrs = sftp.getAttributes(remotePath);
  
  		if (position > attrs.getSize().longValue()) {
  			throw new SftpStatusException(
  					SftpStatusException.INVALID_RESUME_STATE,
  					"The local file size is greater than the remote file");
  		}
  
  		if (progress != null) {
  			progress.started(attrs.getSize().longValue() - position, remotePath);
  		}
  
  		SftpFile file;
  
  		if (transferMode == MODE_TEXT && sftp.getVersion() > 3) {
  			file = sftp.openFile(remotePath, SftpSubsystemChannel.OPEN_READ
  					| SftpSubsystemChannel.OPEN_TEXT);
  
  		} else {
  			file = sftp.openFile(remotePath, SftpSubsystemChannel.OPEN_READ);
  
  		}
  
  		try {
  			sftp.performOptimizedRead(file.getHandle(), attrs.getSize()
  					.longValue(), blocksize, local, asyncRequests, progress,
  					position);
  		} catch (TransferCancelledException tce) {
  			throw tce;
  		} finally {
  
  			try {
  				local.close();
  			} catch (Throwable t) {
  			}
  			try {
  				sftp.closeFile(file);
  			} catch (SftpStatusException ex) {
  			}
  		}
  
  		if (progress != null) {
  			progress.completed();
  		}
  
  		return attrs;
  	}
docs: <p>
  Download the remote file writing it to the specified
  <code>OutputStream</code>. The OutputStream is closed by this method even
  if the operation fails.
  </p>
  
  @param remote
  the path/name of the remote file
  @param local
  the OutputStream to write
  @param progress
  @param position
  the position within the file to start reading from
  
  @return the downloaded file's attributes
  
  @throws SftpStatusException
  @throws SshException
  @throws TransferCancelledException