Method to get an input stream.