[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1648
  • Last Modified:

Deprecated readLine method

 The .readLine is deprecated for string, what would I use instead to still read a  line of string?

           FileInputStream fstream = new
         FileInputStream(args[0]);
         DataInputStream in = new DataInputStream(fstream);
           String line;
                  while((line =in.readLine()) != null) {
0
kellyputty
Asked:
kellyputty
1 Solution
 
objectsCommented:
Use BufferedReader instead

BufferedReader in = new BufferedReader(new InputStreamReader(fstream));
0
 
kellyputtyAuthor Commented:
ah that worked,

my confusion was with this part:
new InputStreamReader(fstream)
thanx
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now