Code example for StringWriter

Methods: getBuffer

0
        OtherGeometryOptions options = new OtherGeometryOptions();
        options.setGeometry(inputGeometry);
        options.setOtherGeometry(otherGeometry);
 
        Reader reader = new StringReader(inputGeometry);
        StringWriter writer = new StringWriter();
 
        DifferenceCommand command = new DifferenceCommand();
        command.execute(options, reader, writer);
        assertEquals("POLYGON ((0 0, 0 10, 5 10, 5 5, 10 5, 10 0, 0 0))", 
                writer.getBuffer().toString());
    } 
}