Looking at #28684, it became apparent that Closeable wasn't really an option but that we could make writeGeneratedContent more prominent and let it throws an IOException. This had a knock-off effect on the tests which was easily handled using our internal TestGenerationContext.
This impacts obviously tests outside of the Spring Framework so a public variant of it is needed.
Looking at #28684, it became apparent that
Closeablewasn't really an option but that we could makewriteGeneratedContentmore prominent and let it throws anIOException. This had a knock-off effect on the tests which was easily handled using our internalTestGenerationContext.This impacts obviously tests outside of the Spring Framework so a public variant of it is needed.