There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
ObjectUtilities.SerializeObjectToBinary(object o) is returning wrong buffer.
The ObjectUtilities.SerializeObjectToBinary(object o) function is returning the buffer obtained via MemoryStream.GetBuffer() which is an internal buffer maintained by MemoryStream and is not supported to hold the exact serialized bytes (will contain extra
bytes at the end). The fix would be to use MemoryStream.ToArray() function.
The issue can be confirmed by comparing the return byte of GetBuffer() and ToArray() functions. The former would be bigger than the latter as it would contain unused space at the end.
The current implementation might still work in most of the cases, but it is not the right thing by principle.