我试图将json文件转换为csv但是出现内存错误。 是否有任何有效的方法来微调此代码以处理python中的大型json文件。
public class VertXSampleServer extends AbstractVerticle {
@Override
public void start() {
HttpServer server=vertx.createHttpServer();
server.requestHandler(new Handler<HttpServerRequest>() {
@Override
public void handle(HttpServerRequest request) {
HttpServerResponse response=request.response();
// by default it is 200 so this is optional
response.setStatusCode(HttpStatus.SC_OK);
System.out.println("re received");
response.putHeader("Content-Length", Integer.toString(5));
// what you're doing here is wrong you should end the response
// response.write("Hello");
response.end("Hello");
// You should use write if you are going to use chunked responses
// and the last one should be a end to notify that the request
// is finished
}
}).listen(9091);
}
}