I don't know whether it's a bug or something that I missed or don't understand but the RandomAccessFile library is so slow that does not seem normal. In my Cache and Archiver libraries I do many writings to the disk with different kinds of objects and these operations are really fast in comparison.
Look at this (with the same data):
WriteObject with no compression: final size = 1475965 bytes, time needed=3606 ms
WriteObject with compression: final size = 300934 bytes, time needed=13600 ms
WriteObject with encryption: final size = 300949 bytes, time needed=14263 ms
Almost 4 seconds for 1 Mb? Is it normal? To have a comparison basis, I used my Archiver lib to read the file created by WriteObject (with no compression), zip it and save it to the disk with a different name. The whole operation took only 1120 ms !
Look at this (with the same data):
WriteObject with no compression: final size = 1475965 bytes, time needed=3606 ms
WriteObject with compression: final size = 300934 bytes, time needed=13600 ms
WriteObject with encryption: final size = 300949 bytes, time needed=14263 ms
Almost 4 seconds for 1 Mb? Is it normal? To have a comparison basis, I used my Archiver lib to read the file created by WriteObject (with no compression), zip it and save it to the disk with a different name. The whole operation took only 1120 ms !