Networking question

From: JONESEY (nospam)
Date: 11/30/03


Date: Sun, 30 Nov 2003 17:10:33 +0000

Im trying to get a text file from a server and load it into a 2
dimensional array. So i came up with the follwoing method. The file is
a table using "|" to indicate the end of a cell and "¬" to indicate
the end of a row. I use if statements to find these but the if
statements done seem to to execute!! Any ideas?

J

    void getFile(String url) throws IOException {
        int x = 0;
        int y = 0;
        StreamConnection c = null;
        InputStream s = null;
        StringBuffer b = new StringBuffer();
        TextBox t = null;
        String temp;
        try {
            c = (StreamConnection)Connector.open(url);
            s = c.openInputStream();
            int ch;
            while((ch = s.read()) != -1) {
                temp = String.valueOf((char)ch);
                if (temp == "|"){
                    fileArray[x][y] = b.toString();
                    
                    x++;
                    b = null;
                }
                else if (temp == "¬"){
                    fileArray[x][y] = b.toString();
                    x = 0;
                    y++;
                    b = null;
                    
                }
                else{
                    b.append((char) ch);
                    t = new TextBox("Fetch Page", b.toString(), 1024,
0);
                }
            }



Relevant Pages

  • Networking problem
    ... Im trying to get a text file from a server and load it into a 2 ... dimensional array. ... So i came up with the follwoing method. ...
    (comp.lang.java.programmer)
  • Re: Networking question
    ... Jose ... > Im trying to get a text file from a server and load it into a 2 ... > dimensional array. ...
    (comp.lang.java.help)
  • Re: Networking question
    ... > Im trying to get a text file from a server and load it into a 2 ... > dimensional array. ... So i came up with the follwoing method. ... I am a little worried about characterset handling here. ...
    (comp.lang.java.help)
  • Re: True Memory Use
    ... We had to actually measure our server (it can handle 1300 ... You have to measure it under load. ... Note that you have to expect 70 seconds for a reverse DNS lookup; ... But of course the GUI *does* consume cycles, so only load simulation is ...
    (microsoft.public.vc.mfc)
  • Re: the future of applications in JavaScript?
    ... more than one server has to be up for success. ... I can't imagine that a brower rendering engine needs to be hand written ... One is make the browser smarter and have longer load times ...
    (comp.lang.javascript)