|
There are 9 total occurrences of MemoryStream class throughout the solution (test projects are excluded):
1. BsonExtensionMethods.ToBson
MemoryStream.GetBuffer() usage is not applicable, because .ToBson() is a public method with byte[] return type, while .GetBuffer() usage requires slicing, otherwise technical size (multiplies of 256) is used, which is definitely not what we intent to do (.ToArray() slices the buffer appropriately).
2. BsonReader.ReadRawBsonArray
Already uses .GetBuffer().
3. BsonStreamAdapter.ReadCStringBytes
Already uses .GetBuffer().
4. RawBsonArray.Materialize
MemoryStream is used as Stream, which does not privide access to .ToArray() and .GetBuffer() methods.
5. CommandMessageFieldEncryptor.CombineCommandMessageSectionsIntoSingleDocument
MemoryStream is used as Stream, which does not privide access to .ToArray() and .GetBuffer() methods.
6. 4 occurrences in GridFSBucket of the same nature
In all 4 occurrences MemoryStream is used as Stream, which does not privide access to .ToArray() and .GetBuffer() methods.
As a summary, no changes are possible to make in scope of this ticket, thus closing it as implemented.
|