示例#1
0
 public void writeBinary(Binary binary) throws IOException {
   _writeArrayFieldNameIfNeeded();
   _verifyValueWrite("write binary");
   byte[] bytes = binary.getData();
   _buffer.putByte(_typeMarker, BsonConstants.TYPE_BINARY);
   _buffer.putInt(bytes.length);
   _buffer.putByte(binary.getType());
   _buffer.putBytes(binary.getData());
   flushBuffer();
 }
示例#2
0
 private Comparable<String> convertFrom(Binary binary) {
   return new String(
       binary
           .getData()); // + binary.getType(); // Adding getType() to respect contract of "equals";
 }
 public Builder initialTimestamp(Binary initialTimestamp) {
   this.initialTimestamp = new Timestamp.GTID(initialTimestamp.getData(), null);
   return this;
 }
示例#4
0
 protected void putBinary(String name, Binary val) {
   _put(BINARY, name);
   _buf.writeInt(val.length());
   _buf.write(val.getType());
   _buf.write(val.getData());
 }