@Override
  public byte[] getBinaryValue(Base64Variant variant) throws IOException {
    if (type() != BsonType.BINARY) {
      throw new JsonParseException(this, String.format("Can't read binary data. Expected type %s got %s", BsonType.BINARY, type()));
    }

    if (!context.hasValue()) {
      readValue();
    }

    return (byte[]) context.value;
  }
Read next token in the stream
criteria/mongo/src/org/immutables/criteria/mongo/bson4jackson/BsonParser.java