@Override
  public void writeNumber(BigDecimal number) throws IOException {
    try {
      writer.writeDecimal128(new Decimal128(number));
    } catch (NumberFormatException e) {
      writer.writeString(number.toString());
    }
  }
Delegates all streaming API to {@link BsonWriter}.
mongo/src/org/immutables/mongo/bson4jackson/BsonGenerator.java