A preload library partitions certain files into segments and transforms
the data of the files on a segment by segment basis, each independently
of the other. The transformed segments are then stored as part of a
transformed file, with each segment corresponding to a bag containing a
chunk (of transformed data) and a gap which permits the chunks to grow
when data of the segment is modified during a write operation. The bags
are followed by a chunk map which contains metadata defining the
compressed version of each segment. The preload library intercepts system
calls from applications to the OC specifying access to specific segments
of a transformed file. The preload library identifies the chunks
corresponding to the specified segments, retrieves and reverses the
transform on those chunks and passes the data to the application
requesting it. For a system call to write data to certain segments, the
data is modified and re-transformed by the library before being written
back to disk. A preload library provides improved random access into
transformed (e.g. compressed, encrypted, etc.) files.