Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2004

    InputStream.isAvailable() bug?

    Hi all,

    I am currenctly packaging all my images in a single file sharing headers, and reading them with a stream like this:

    InputStream is = getClass().getResourceAsStream("pngs.pns");

    System.out.println("AVAILABLE: " + is.available());

    byte[] all = new byte[is.available()];
    is = null;

    int n = 0;

    System.out.println("LENGTH IS " + all.length);

    But both printlns give me 0 on 7210 and on my friends t610 he says he gets "This application uses too much memory". Should I split the data into smaller chunks(cant see how that would change things as this file is only 2 kb big, and when reading without using isAvailable(), I see there IS content to be read).
    Last edited by darcone; 2004-04-05 at 11:29.

  2. #2
    Registered User
    Join Date
    Mar 2004
    I solved it, heh
    At least on the 7210, is Available() isnt working properly.

Posting Permissions

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