is it possible to monitor progress of writeObject and readObject methods?
Also I need to determine size of object I am going to write: I was thinking about write my Object into ByteArrayOutputStream so that I can determine its size, but is there any way how to monitor serialisation process itself?
thanks a lot
You can extends ByteArrayOutputStream to see each block of data as it is passed.
However, the serialization should typically complete in sub second timing so monitoring its progress may not be very useful.
It is possible to monitor any stream by writing a FilterInputStream or FilterOutputStream. See for example javax.swing.ProgressMonitorInputStream.
As Peter suggests, the performance of an individual readObject() or writeObject() method will be unmeasurable, unless you are writing enormous object graphs.