problem with reading and wrting to file

  • Thread starter Narayanan Kaleeswaram
  • Start date
N

Narayanan Kaleeswaram

Hi,

How to read large file and display it into a JTextPane.I am using
a BufferedReder(using readLine()), but it is taking very much time to
read the entire content from the file and i felt it hanging the
system.Is there any better way to read from the file?
same way i would like to know how to write large data to a
file.
thanks in advance for any response.
thank you.
 
R

Roedy Green

How to read large file and display it into a JTextPane.I am using
a BufferedReder(using readLine()), but it is taking very much time to
read the entire content from the file and i felt it hanging the
system.Is there any better way to read from the file?

for code to read the file, see http://mindprod.com/fileio.html

Consider reading it unbuffered with a single i/o, then feed it all at
once to the JTextPane.
 
Y

Yu SONG

Narayanan Kaleeswaram said:
Hi,

How to read large file and display it into a JTextPane.I am using
a BufferedReder(using readLine()), but it is taking very much time to
read the entire content from the file and i felt it hanging the
system.Is there any better way to read from the file?
same way i would like to know how to write large data to a
file.
thanks in advance for any response.
thank you.

Don't use readLine, unless it is necessary.

btw,
use Thread & ProgressBar will help a lot

--
Song

/* E-mail.c */
#define User "Yu.Song"
#define At '@'
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s%c%s", User, At, Warwick);
return 0;}

Further Info. : http://www.dcs.warwick.ac.uk/~esubbn/
_______________________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top