Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

challenge in i/o  RSS feed

 
Jubil Schek
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to load a file stream as fast as possible, also unsing swing with stop button, a textarea and a jprogress without thread problems too?
 
David Nemeskey
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want to load a file stream, or a file? I would check the NIO package, it has methods to use the buffers of the operating system, so it is even faster than BufferedInputStream.

For the GUI part, I would use SwingWorker - have a look at swingworker.dev.java.net, also this is a nice wrap-up on the issue.

Of course, it all depends on the java version used, NIO was introduced in 1.4, but since that is the oldest supported java version, I hope it is not a problem
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As with all things in performance, there is no one-size-fits-all answer. Have a look at this discussion comparing various stream and NIO based file operations. You have to benchmark and test against your own requirements to find the best answer.
Also, have a look at our faq for a discussion of the Swing thread problem and solutions.
[ November 08, 2006: Message edited by: Joe Ess ]
 
Jubil Schek
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, thanks...I'll take a look at those links!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!