Changed input method to InputStream