Reputation: 151
I have some kind of simple reporting application that reports in HTML.
Every report has a status (pass/fail) and the differences are in the text color (green/red).
The report also works with hierarchy so some of the reports have "parent links".
I managed to set the parent's link color from "green" to "red" upon the child's status change to "fail" but currently it is being done by reading the file, changing the color in the HTML and re-writing it again.
Assuming that I can "know" the color offset, what will be more efficient: the old method or using the RandomAccessFile class? Or do you have another idea?
Upvotes: 0
Views: 102
Reputation: 151
After a while, I implemented an own test for this - comparing a whole file writing vs. random access.
The random access was faster 4 times than the whole file writing method.
(Tested on the same machine, same application, 10000 iterations, each iteration with around 50 writes to the disk, droped highest, and lowest 10 precents of the results)
Upvotes: 1