• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read file

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The second while doesn't work , why?

I want to compare and test difference between readline and read.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless.

The first loop exhausts the input - there's nothing left for the second loop to read.
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Comment for first while loop then you will know how second while loop execute.
 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then the solution is that I must create new FileInputStream?
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also create new BufferedReader to read from the top.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic