* Added writeTo method for upwards compatibility with grails 2.3.x