Re: [Simple-support] implementing a progress bar
Brought to you by:
niallg
|
From: Aaron D. <di...@he...> - 2011-09-21 18:29:02
|
Am 21.09.2011 15:05, schrieb Krein, Jörg: > Hi, > > I need to add a progress bar to visualize the (de)serialization process. > Please give me some hints how to achive this. > From what I understand one way is to use a visitor? > A simple example would be very helpful. That depends on what you know. Do you know in advance how many XML elements the document contains? If not, do you know the file size? If you know the latter, you can create an InputStream (derived from FilterInputStream) which updates a counter with the number of bytes read so far. That allows you to read this information from a second thread or by triggering a callback after a certain number of bytes have been read. In the former case, you need to hook into the (de)serialization process. I'm not sure whether a visitor is really helpful here. Regards, -- Aaron "Optimizer" Digulla a.k.a. Philmann Dark "It's not the universe that's limited, it's our imagination. Follow me and I'll show you something beyond the limits." http://blog.pdark.de/ |