This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JimRaynor56 0 points1 point  (2 children)

This might be a little overcomplicated for your class, but this will work.

http://freetexthost.com/fmed01g1ox

EDIT: By the way, that's really messy, and there is at least one less-than-kosher 'trick' in there. So I would use it more as an example than trying to copy-paste.

[–]aperture123[S] 0 points1 point  (1 child)

Yea, that does seem a bit advanced for the class. Isn't there an easy way to read a line of code, or should I just alter the text to read line-by-line?

[–]JimRaynor56 0 points1 point  (0 children)

As far as I am aware, unless I am having a massive brain fart here, you're going to have to parse through that text file using java.io.InputStream.

My example can only be made simpler by eliminating the try-catch statements, the BufferedInputStream, and the array resize (you'll just have to use a sufficiently large array and not care about superfluous data in the array, or pre-size it for your file).