Package org.vertx.java.core.buffer

Examples of org.vertx.java.core.buffer.Buffer.appendBuffer()


            }
            final Buffer body = new Buffer();

            vertxRequest.dataHandler(new Handler<Buffer>() {
                public void handle(Buffer buff) {
                    body.appendBuffer(buff);
                    if (body.length() > maxBodySize) {
                        throw new RuntimeException("The input stream has exceeded the max allowed body size "
                                + maxBodySize + ".");
                    }
                }
View Full Code Here


            }
            final Buffer body = new Buffer();

            vertxRequest.dataHandler(new Handler<Buffer>() {
                public void handle(Buffer buff) {
                    body.appendBuffer(buff);
                    if (body.length() > maxBodySize) {
                        throw new RuntimeException("The input stream has exceeded the max allowed body size "
                                + maxBodySize + ".");
                    }
                }
View Full Code Here

        readStream.dataHandler(new Handler<Buffer>() {
            Buffer received = new Buffer();

            @Override
            public void handle(Buffer event) {
                received.appendBuffer(event);
                for (final Protocol protocol : protocols) {
                    if (protocol.matches(received)) {
                        if ("ssl".equals(protocol.getProtocolName())) {

                            LOG.info(String.format("SSL Connection from '%s'", socket.remoteAddress()));
View Full Code Here

            byte[] data = value.getBytes("UTF-8");
            Buffer rc = new Buffer(data.length);
            for (byte d : data) {
                switch (d) {
                    case ESCAPE_BYTE:
                        rc.appendBuffer(ESCAPE_ESCAPE_SEQ.toBuffer());
                        break;
                    case COLON_BYTE:
                        rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
                        break;
                    case NEWLINE_BYTE:
View Full Code Here

                switch (d) {
                    case ESCAPE_BYTE:
                        rc.appendBuffer(ESCAPE_ESCAPE_SEQ.toBuffer());
                        break;
                    case COLON_BYTE:
                        rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
                        break;
                    case NEWLINE_BYTE:
                        rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
                        break;
                    default:
View Full Code Here

                        break;
                    case COLON_BYTE:
                        rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
                        break;
                    case NEWLINE_BYTE:
                        rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
                        break;
                    default:
                        rc.appendByte(d);
                }
            }
View Full Code Here

  @Override
  public HttpServerRequest bodyHandler(final Handler<Buffer> bodyHandler) {
    final Buffer body = new Buffer();
    dataHandler(new Handler<Buffer>() {
      public void handle(Buffer buff) {
        body.appendBuffer(buff);
      }
    });
    endHandler(new VoidHandler() {
      public void handle() {
        bodyHandler.handle(body);
View Full Code Here

  @Override
  public HttpClientResponse bodyHandler(final Handler<Buffer> bodyHandler) {
    final Buffer body = new Buffer();
    dataHandler(new Handler<Buffer>() {
      public void handle(Buffer buff) {
        body.appendBuffer(buff);
      }
    });
    endHandler(new VoidHandler() {
      public void handle() {
        bodyHandler.handle(body);
View Full Code Here

            }
            final Buffer body = new Buffer();

            vertxRequest.dataHandler(new Handler<Buffer>() {
                public void handle(Buffer buff) {
                    body.appendBuffer(buff);
                    if (body.length() > maxBodySize) {
                        throw new RuntimeException("The input stream has exceeded the max allowed body size "
                                + maxBodySize + ".");
                    }
                }
View Full Code Here

        if (shouldReadData(vertxRequest)) {
            final Buffer body = new Buffer();

            vertxRequest.dataHandler(new Handler<Buffer>() {
                public void handle(Buffer buff) {
                    body.appendBuffer(buff);
                    if (body.length() > maxBodySize) {
                        throw new RuntimeException("The input stream has exceeded the max allowed body size "
                                + maxBodySize + ".");
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.