J
joseph.paterson
Hi everyone,
I'm trying to open and read from a file using J2ME, but I seem to have
a problem.
Essentially, I do this:
try
{
input = Connector.openDataInputStream ("words");
} catch (Exception e) { this.notifyDestroyed (); }
I also tried using file://words, but I get an error. Is there a way for
figuring what directory the Class is being executed in (so I could use
file://${{PATH}words)? I looked into System.getProperty (), but found
nothing.
I also thought of putting the contents of the 'words' file directly
into my .java code, but as the file is around 600kb (it's a
dictionary...) I get a code too large error.
Also, once I do actually figure out how to open and read from this
file, should I read Byte's from the file or Char's ?
Cheers,
- Joseph Paterson
I'm trying to open and read from a file using J2ME, but I seem to have
a problem.
Essentially, I do this:
try
{
input = Connector.openDataInputStream ("words");
} catch (Exception e) { this.notifyDestroyed (); }
I also tried using file://words, but I get an error. Is there a way for
figuring what directory the Class is being executed in (so I could use
file://${{PATH}words)? I looked into System.getProperty (), but found
nothing.
I also thought of putting the contents of the 'words' file directly
into my .java code, but as the file is around 600kb (it's a
dictionary...) I get a code too large error.
Also, once I do actually figure out how to open and read from this
file, should I read Byte's from the file or Char's ?
Cheers,
- Joseph Paterson