The file header should be shared between all related OpenFileobjects (ChunkSaver, ChunkLoader and CleartextFileChannel via the file header holder to ensure consistency. But only the Chunk* classes share the header. The CleartextFileChannel, once created, uses always the same header.
This causes data corruption, if during the lifetime of the channel the file header changes. (e.g., by opening a second file channel and closing it again).
The file header should be shared between all related
OpenFile
objects (ChunkSaver
,ChunkLoader
andCleartextFileChannel
via the file header holder to ensure consistency. But only theChunk*
classes share the header. The CleartextFileChannel, once created, uses always the same header.This causes data corruption, if during the lifetime of the channel the file header changes. (e.g., by opening a second file channel and closing it again).
Example test code: