Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

progress bar while reading object

 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there a simple way to show progress bar while reading a big object? Maybe my reader can be wrapped with another object which adds progress bar?
I have also the second question. I am writing a big object to file. Is there a chance to give writing thread a higher priority? I am using 'writeObject' method from ObjectOutputStream.
 
Rob Spoor
Sheriff
Pie
Posts: 20753
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucas Smith wrote:Is there a simple way to show progress bar while reading a big object? Maybe my reader can be wrapped with another object which adds progress bar?

ProgressMonitorInputStream. It has one flaw though - it uses available() to determine the maximum for its matching ProgressMonitor. That (usually) works good for local files, but for anything read from the Internet it may not work as you want.

I am writing a big object to file. Is there a chance to give writing thread a higher priority? I am using 'writeObject' method from ObjectOutputStream.

Thread.setPriority(int priority).
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's clear, thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic