Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1900

Can encode but not decode Binary UUID's with invalid lengths

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.4.0-rc1, 3.4.0
    • Affects Version/s: 3.0.0, 2.13.2
    • Component/s: BSON
    • None

      Currently can't round trip

              byte[] data = [65, 66, 82, 87, 84, 73, 70, 71, 80, 69, 101, 83, 70, 102, 54, 57, 102, 73, 83, 65, 79, 65, 61, 61]
              byte type = 0x03
              def binary = new Binary(type, data)
      
              def document = new BasicDBObject("_id", binary)
      
              def encoder = new BasicBSONEncoder()
              def decoder = new BasicBSONDecoder()
              def callback = new BasicBSONCallback();
      
              then:
              def encoded = encoder.encode(document)
              decoder.decode(encoded, callback)  // FAILS
      

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: