rspec/rules/S2689/description.adoc
2021-10-18 16:27:36 +02:00

5 lines
575 B
Plaintext

``++ObjectOutputStream++``s are used with serialization, and the first thing an ``++ObjectOutputStream++`` writes is the serialization stream header. This header should appear once per file, at the beginning. Pass a file opened in append mode into an ``++ObjectOutputStream++`` constructor and the serialization stream header will be added to the end of the file before your object is then also appended.
When you're trying to read your object(s) back from the file, only the first one will be read successfully, and a `StreamCorruptedException` will be thrown after that.