If generated ObjectOutputStream.pos < 1024 after writing all data a OOS....

...flush() is needed to write the cached data to the ObjectDataOutput.