Reputation: 41
Have a use case where I need to compress and store a org.bson.Document into cache. I am using zstd compression which expects a byte array. Not able to find a way to convert Document into byte array.
Upvotes: 0
Views: 1099
Reputation: 58
Only way I know of is to go via a JSON file, and then to a ByteArray.
You would then have to go via a JSON back to BsonDocument for when you want to use it again.
Upvotes: 1