Method for conversion from File to ByteArrayInputStream