@Override
  public BigInteger getBigIntegerValue() throws IOException {
    final Number value = getNumberValue();

    if (value instanceof BigInteger) {
      return (BigInteger) value;
    } else if (value instanceof BigDecimal) {
      return ((BigDecimal) value).toBigInteger();
    }

    return BigInteger.valueOf(value.longValue());
  }
The ObjectCodec used to parse the Bson object(s)
mongo/src/org/immutables/mongo/bson4jackson/BsonParser.java