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();
 
        IntersectionCommand command = new IntersectionCommand();
        command.execute(options, reader, writer);
        assertEquals("POLYGON ((5 10, 10 10, 10 5, 5 5, 5 10))", 
                writer.getBuffer().toString());
    } 
}