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();
 
        SymDifferenceCommand command = new SymDifferenceCommand();
        command.execute(options, reader, writer);
        assertEquals("MULTIPOLYGON (((0 0, 0 10, 5 10, 5 5, 10 5, 10 0, 0 0)), " 
                + "((10 5, 10 10, 5 10, 5 20, 20 20, 20 5, 10 5)))", 
                writer.getBuffer().toString());
    } 
}