×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    50

    cannot find symbol BufferedReader

    I have this code to read a txt file for Series 40

    Code:
    private void ReadTxt() {
            String thisLine="";
            try {
                InputStream is = this.getClass().getResourceAsStream("/src/res/txt/myFile.txt");
                
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
                while ((thisLine = br.readLine()) != null) {
                    //System.out.println(thisLine);
                    lstOpera.append(thisLine, null);
                }
                br.close();
                is.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
    }
    The problem is that gives me the following error:
    Code:
    C:\Work_java\SMSDcs\src\dcs\elo\sms\SMSDcs.java:866: cannot find symbol
    symbol  : class BufferedReader
    location: class dcs.elo.sms.SMSDcs
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
    C:\Work_java\SMSDcs\src\dcs\elo\sms\SMSDcs.java:866: cannot find symbol
    symbol  : class BufferedReader
    location: class dcs.elo.sms.SMSDcs
                BufferedReader br = new BufferedReader(new InputStreamReader(is));
    2 errors
    C:\Work_java\SMSDcs\nbproject\build-impl.xml:174: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)
    What can I do to make this working?

    Another question that I have is if I can read a txt file outside a jar, i.e., without compiling a both jar and txt (present in resources) together???

    -----
    Thank's for the help
    Last edited by decisor; 2006-06-27 at 10:45.

  2. #2
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,699

    Re: cannot find symbol BufferedReader

    hi,

    #1
    there is no standard JDK BufferedReader class in midp/cldc,
    you can use DataInputStream to wrap your InputStream
    #2
    for example to load file from resource jar see:
    http://discussion.forum.nokia.com/fo...sourceAsStream

    hth,
    regards,
    Peter

Similar Threads

  1. error LNK2019: unresolved external symbol ???
    By wgarnett in forum Symbian
    Replies: 3
    Last Post: 2009-09-28, 06:53
  2. error LNK2001: Please Help
    By sourish_khan in forum Symbian
    Replies: 9
    Last Post: 2006-04-19, 11:16
  3. 21 errors in j2me , help in soving them
    By abhishek_1211 in forum General Messaging
    Replies: 0
    Last Post: 2006-04-01, 09:04
  4. S80 Platform SDK and Visual Studio .NET Linking Error
    By jayantjain in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2005-10-07, 22:14
  5. Unresolved external symbols problem
    By georgica1979 in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-06, 13:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •