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