-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 1.7
-
Component/s: None
-
None
-
None
-
Minor Change
-
None
-
None
-
None
-
None
-
None
-
None
When the IO namespace of the BSON library was originally written care was taken to make sure that it didn't depend on the BsonDocument object model. The reason was that we can implement more efficient serialization if there are no required intermediate data types, so the IO layer tends to work with primitive values. However, for a few BSON data types, that principle led to awkward method signatures.
So we are replacing:
// replace: public abstract void ReadBinaryData(out byte[] bytes, out BsonBinarySubType subType, out GuidRepresentation guidRepresentation); // with: public abstract BsonBinaryData ReadBinaryData(); // add: public abstract byte[] ReadBytes(); // replace: public abstract void ReadObjectId(out int timestamp, out int machine, out short pid, out int increment); // with: public abstract ObjectId ReadObjectId(); // replace: public abstract void ReadRegularExpression(out string pattern, out string options); // with: public abstract BsonRegularExpression ReadRegularExpression();
and similarly for BsonWriter.
These methods are very low level, and these will only be breaking changes to you if you used them to write custom serializers.