Fixed `getStream` method to not create the `File` object twice.