commons-math
commons-math copied to clipboard
Flush ObjectOutputStream before calling toByteArray on underlying ByteArrayOutputStream
When an ObjectOutputStream instance wraps an underlying ByteArrayOutputStream instance,
it is recommended to flush or close the ObjectOutputStream before invoking the underlying instances's toByteArray().
This pull request adds a call to the flush method before calls to the toByteArray method.