title: How can convert inputstream to InputStreamsource or Datasource to attach in Spring JavaMail
body: <p>I am getting inputstream from the Jsch channelSFTP like below.</p>
  <pre><code>   ChannelSftp channelSftp = (ChannelSftp) channel;
     InputStream input = channelsftp.get(unixPath); // unixPath is path to my file which is on SFTP server
  </code></pre>
  <p>I have to attach the file in the <code>unixPath</code> in the Spring JavaMail attachment. But when I see API of Spring JavaMail <a href="http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/mail/javamail/MimeMessageHelper.html#addAttachment%28java.lang.String,%20javax.activation.DataSource%29" rel="nofollow noreferrer"><code>addAttachment()</code></a> method it takes only <code>InputStreamSource</code> or <code>Datasource</code>.
  My problem is I am not able to get the <code>InputStreamSource</code> or <code>Datasource</code> from the inputStream which I am getting form SFTP channel.</p>
  <p>How Can I get <code>InputStreamSource</code> or <code>Datasource</code> from the above <code>InputStream</code>?</p>