This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BigDecimalCodec implements Codec<BigDecimal> { | |
| // Note that you may not want it to be double -- choose your own type. | |
| @Override | |
| public void encode(final BsonWriter writer, final BigDecimal value, final EncoderContext encoderContext) { | |
| writer.writeDouble(value); | |
| } | |
| @Override | |
| public BigDecimal decode(final BsonReader reader, final DecoderContext decoderContext) { | |
| return reader.readDouble(); |