@Override
                public void end() {
                    if (readBuffer.length() > 0) {
                        DataTransformer dataTransformer = DataTransformerFactory.getDataTransformer(serverFormat, clientFormat);
                        IApimanBuffer writeBuffer = bufferFactory.createBuffer(readBuffer.length());

                        String data = dataTransformer.transform(new String(readBuffer.getBytes()));
                        writeBuffer.append(data);

                        super.write(writeBuffer);
                    }
                    super.end();
                }
@see io.apiman.gateway.engine.policy.IDataPolicy#getResponseDataHandler(io.apiman.gateway.engine.beans.ApiResponse, io.apiman.gateway.engine.policy.IPolicyContext, java.lang.Object)
plugins/transformation-policy/src/main/java/io/apiman/plugins/transformation_policy/TransformationPolicy.java