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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 3.4.0-rc1, 3.4.0
    • 3.0.0, 2.13.2
    • BSON
    • None

    Description

      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
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: