This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes bufferedReader.readLine() random order of lines ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "bufferedReader.readLine() random order of lines ?" Watch "bufferedReader.readLine() random order of lines ?" New topic
Author

bufferedReader.readLine() random order of lines ?

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
Why this is reading lines of text in completely randome order, not from top to bottom ?



Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
ahh, forget that, my mistake.
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

You are mistaken. Since you are reading from a Reader which is just a stream of chars it must read from 'top to bottom'.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2258
    
    3

Howdy, Miran!

Can you show us your solution, champ? This can be helpful to other people that run into the same mistake as you in the future.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
I just had one extra



before while so it started reading at second line.
Showing that in some text boxes further confused things.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: bufferedReader.readLine() random order of lines ?
 
Similar Threads
equalsIgnoreCase
Runtime.getRuntime() help plzzzzzzzz
reading integers using System.in
waitFor to get data from server
reading from system command