I want to convert a FileInputStream
to a S3ObjectInputStream
.
This is my current code:
InputStream is = new FileInputStream(file);
S3ObjectInputStream sObject = (S3ObjectInputStream)is;
However, it's giving the error:
java.io.FileInputStream cannot be cast to com.amazonaws.services.s3.model.S3ObjectInputStream
You need cast as a InputStream
InputStream is = new FileInputStream(file);
S3ObjectInputStream sObject = (InputStream) is;
Hope it helps