OptionalDataException has two public fields: a boolean eof, and an int length. Can you print those from the exception object? If eof is set to true, it means that the data somehow got truncated, and that the rest of the object bytes are missing. If that's the case, I would suggest creating a small test just with that one object on which the deserialization fails, and serializing and deserializing it.
↧