View Single Post
Old 11-21-2011, 10:27 PM   #3
berryapp
Knows Where the Search Button Is
 
Join Date: Nov 2011
Model: 9800T
PIN: N/A
Carrier: Rogers Canada
Posts: 34
Default Re: Read String in File text.

Like in the earlier reply, once you have the connection, you could get the InputStream. You can then use the IOUtilities class provided by RIM to read the whole content into an array.

InputStream in = fconn.openInputStream();
byte[] data = IOUtilities.streamToBytes( in );

You could then set the data in a StringBuffer,

StringBuffer sb = new StringBuffer(data.length);
sb.append(data);

For small data file this would be an easier way to go.
Offline   Reply With Quote