• 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
Posts: 20831
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!
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!