Changed the FileInputStream and FileOutputStream in the method signatures into InputStream and OutputStream