private JsonDecoder(Symbol root, InputStream in) throws IOException {
    super(root);
    configure(in);
  }
@Test
  void testFloatPrecision() throws Exception {
    String def = "{\"type\":\"record\",\"name\":\"X\",\"fields\":" + "[{\"type\":\"float\",\"name\":\"n\"}]}";
    Schema schema = new Schema.Parser().parse(def);
    DatumReader<GenericRecord> reader = new GenericDatumReader<>(schema);

    float value = 33.33000183105469f;
    GenericData.Record record = new GenericData.Record(schema);
    record.put(0, value);
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    JsonEncoder encoder = EncoderFactory.get().jsonEncoder(schema, out);

    DatumWriter<GenericRecord> writer = new GenericDatumWriter<>(schema);
    writer.write(record, encoder);
    encoder.flush();
    // check the whole float precision is kept.
    assertEquals("{\"n\":33.33000183105469}", out.toString());

    Decoder decoder = DecoderFactory.get().jsonDecoder(schema, out.toString());
    GenericRecord r = reader.read(null, decoder);
    assertEquals(value + 0d, ((float) r.get("n")) + 0d);
  }