[4744] in java-interest

home help back first fref pref prev next nref lref last post

How can I check End Of File?

daemon@ATHENA.MIT.EDU (Kyungsoon Park)
Fri Jan 12 06:51:10 1996

Date: Fri, 12 Jan 1996 19:05:54 +0900
To: java-interest@java.sun.com
From: Kyungsoon Park <sosarian@bae.nuri.net>

Hi,

How can I check the End Of File?
There is no keyword EOF or eof.


try{ 
        String FileName="111";
        URL url=new URL(getDocumentBase(), FileName);
        int pp=0;
        try
        {
                DataInputStream ff=new DataInputStream(url.openStream());
                while (nextLine(ff)!=null)
                {
                        g.drawString(Integer.toString(pp), pp*10+30, 100);
                        pp++;
                }
        } catch (IOException e)	{ }

        //nextLine method read a line from a file with readLine() method.
		
It occurs an "java.lang.NullPointerException" error.
It displays from 0 to 42(total 43 lines, it's right) and then occurs the error. 
What's my problem?
What is the best way to check the end of file?
				

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post