title: How do I convert an InputStream to S3ObjectInputStream in Java?
body: <p>I want to convert a <code>FileInputStream</code> to a <code>S3ObjectInputStream</code>.</p>
  <p>This is my current code:</p>
  <pre class="lang-java prettyprint-override"><code>InputStream is = new FileInputStream(file);
  S3ObjectInputStream sObject = (S3ObjectInputStream)is;
  </code></pre>
  <p>However, it's giving the error:</p>
  <pre><code>java.io.FileInputStream cannot be cast to com.amazonaws.services.s3.model.S3ObjectInputStream
  </code></pre>