@Override
                public void end() {
                    // Write close parenth ) on end if something has been written
                    if (!firstChunk) {
                        IApimanBuffer buffer = bufferFactory.createBuffer(CLOSE_PARENTHESES.length());
                        try {
                            buffer.append(CLOSE_PARENTHESES, encoding);
                        } catch (UnsupportedEncodingException e) {
                            // TODO Review the exception handling. A better approach might be throwing an IOException.
                            throw new RuntimeException(e);
                        }
                        super.write(buffer);
                    }
                    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/jsonp-policy/src/main/java/io/apiman/plugins/jsonp_policy/JsonpPolicy.java