what is the 'quickest' way to read char data from a txt file

Hello,What is the 'quickest' way to read character data from a txt file stored on the phone to be displayed into the screen?Regards
[161 byte] By [vjpa] at [2007-10-2 5:21:40]
# 1
Blody double poster: http://forum.java.sun.com/thread.jspa?threadID=683300&tstart=0 !!!Quickest way it it use buffers, so read whole bloks of data at ones
deepspacea at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Sorry if I caused you any offence. I'm just like any other person trying to find a better solution to the one I have already. So thank you for your constructive or in this case unconstructive comment.

By the way, next time you decide to hurl some abuse over please choose to construct and spell your sentences properly.

vjpa at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

I really don't care about spelling. As far as I know, you knew exactly what I ment, so it's just fine. Besides, not all of us have English as our native language. I would like to see you cope with Ducth....

About beeing constructive: I was, you just didn't read past the fist paragraph!

deepspacea at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
But still, I'll have to excuse me... I had two tabs with the same url open... So my error :( It's no bouble post!
deepspacea at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5

To be even a bit more constructive...

Since J2me does not have a BufferedInputStream, it will help to implement it yourself. It's much faster since you read large blocks at ones in stread of seperate chars.

something line this lets you read lines very fast:

while ( bytesread < filesize ) {

length = configfile.read( buff, 0, buff.length );

// append buffer to temp String

if ( length < buff.length ) {

byte[] buf = new byte[length];

System.arraycopy( buff, 0, buf, 0, length );

tmp.append( new String( buf ) );

} else {

tmp.append( new String( buff ) );

}

// look in tmp string for \r\n

idx1 = tmp.toString().indexOf( "\r\n" );

while ( idx1 >= 0 ) {

//if found, split into line and rest of tmp

line = tmp.toString().substring( 0, idx1 );

/// ... do with it whatever you want ... ////

tmp = new StringBuffer( tmp.toString().substring( idx1 + 2 ) );

idx1 = tmp.toString().indexOf( "\r\n" );

}

bytesread += length;

}

deepspacea at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
And if the forum had an edit function, I could even correct my spelling errors ;)
deepspacea at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7
Thank you for your help. Much appreciated. Have a good day!
vjpa at 2007-7-16 1:23:37 > top of Java-index,Java Mobility Forums,Java ME Technologies...