Code example for StringWriter

Methods: getBuffer

0
        PrecisionReducerOptions options = new PrecisionReducerOptions();
        options.setGeometry(inputGeometry);
        options.setPrecisionModelType("floating");
 
        Reader reader = new StringReader(inputGeometry);
        StringWriter writer = new StringWriter();
         
        command.execute(options, reader, writer);
        assertEquals("POINT (5.19775390625 51.07421875)", writer.getBuffer().toString());
         
        // Fixed 
        inputGeometry = "POINT (5.19775390625 51.07421875)";
        options = new PrecisionReducerOptions();
        options.setGeometry(inputGeometry);
        options.setPrecisionModelType("fixed");
        options.setPrecisionModelScale(10);
 
        reader = new StringReader(inputGeometry);
        writer = new StringWriter();
         
        command.execute(options, reader, writer);