Hi Josh,
I think the problem is that you are getting a bit confused between the files that Jython uses (Python files), and the files that Java uses. A Python file only has the read(), readline() and readlines() methods and they read Jython strings.
So you can do something like line=file1.read() to get a
string (line) from the file. line will have the value None at the end of the file. You would the have to split the strings and coerce the bits that are representing integers: i = int(piece) , where piece is a string '42', say.
To do Java-like processing you would have to create a DataInputStream and use its readInt() method. But that would only work with files created with DataOutputStream.writeInt().
The important thing is to realize that the Python IO is independent from Java IO and is a viable simple alternative to the Java IO.
Now I'm going to play with your file, to see if I'm talking sense or not
-Barry
BTW you don't import methods but modules (or Java packages/classes).
Also a book: "Jython Essentials, Samuele Pedroni, Noel Rappin, O'Reilly"
[ March 01, 2003: Message edited by: Barry Gaunt ]