Hi!
I'm in the process of updating a project from 0.20.13 to 1.0.4. Reactivemongo bson library has been so nice to use that we've been using it for quite some time in communication with some other services. We create akka.util.ByteString objects that are passed over the network.
In 0.20 it was really easy to make a ByteString out of a BSONDocument with:
val buffer = new ArrayBSONBuffer()
BSONDocument.write(doc, buffer)
ByteString.fromArray(buffer.array)
And again read an incoming ByteString bytes to a BSONDocument doc:
val buffer = new ArrayBSONBuffer()
val doc = BSONDocument.read(buffer.writeBytes(bytes.toArray).toReadableBuffer())
In 1.0.4 the ArrayBSONBuffer has been removed and that makes it difficult to upgrade. I've been trying to find an alternate way to create the ByteString from a BSONDocument, but so far I'm drawing blank.
While it's not the responsibility of a Mongo driver library to provide this functionality, is anyone aware of an alternative I could use with 1.0.4?
Respectfully,
Valtteri