Using input Streams instead of files