2

I am working on an android app so I need to use an InputStream() to read a txt file but I also have several methods that only work with Scanner() so I need a way to convert InputStream() to Scanner().

Thanks in advance.

bumbumpaw
  • 2,522
  • 1
  • 24
  • 54
user3789915
  • 71
  • 1
  • 1
  • 7

1 Answers1

6

You can open scanner for this input stream. Like that:

// inputStreamInstance - input stream you want to convert to scanner
Scanner scanner = new Scanner(inputStreamInstance);