Add conversions between ObjectId and ByteBuffer

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Minor - P4
    • 3.4.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add conversions to/from java.nio.ByteBuffer via the new putToByteBuffer method and a new constructor. This is useful for users who want to avoid the GC overhead of allocating a byte array when serializing an ObjectId to bytes.

      A good example of where this is useful is when serializing or deserializing an ObjectId within a larger ByteBuffer where it does not make sense to allocate a byte array for the sole purpose of extracting the ObjectId from the larger buffer.

      Pull Request: https://github.com/mongodb/mongo-java-driver/pull/368

              Assignee:
              Jeffrey Yemin
              Reporter:
              Tom Dyas
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: