Package org.jboss.netty.buffer

Examples of org.jboss.netty.buffer.ChannelBuffer.readable()


      if (qsdParameters != null) {
        this.parameters.putAll(qsdParameters);
      }
      // http post
      ChannelBuffer content = request.getContent();
      if (content.readable()) {
        String charsetName = Constants.SC_CHARACTER_SET;
        if (request.containsHeader(HttpHeaders.Names.ACCEPT_CHARSET)) {
          String contentType = request.getHeader(HttpHeaders.Names.ACCEPT_CHARSET);
          charsetName = contentType.indexOf("charset=") > -1 ? contentType.substring(contentType.indexOf("charset=") + 8)
              : charsetName;
View Full Code Here


   
    public String getHttpMessageContent(MessageEvent e) {
    String requestContent = null;
    HttpRequest request = (HttpRequest) e.getMessage();
    ChannelBuffer content = request.getContent();
        if (content.readable()) {
          requestContent = content.toString(CharsetUtil.UTF_8);
          logger.debug("InstrumentationMenu: \n" + requestContent);
        }
    return requestContent;
  }
View Full Code Here

            ctx.sendUpstream(e);
            return;
        }

        ChannelBuffer input = (ChannelBuffer) m;
        if (!input.readable()) {
            return;
        }

        ChannelBuffer cumulation = cumulation(ctx);
        cumulation.discardReadBytes();
View Full Code Here

    private void cleanup(ChannelHandlerContext ctx, ChannelStateEvent e)
            throws Exception {
        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all data was read before notifying a closed channel.
                callDecode(ctx, e.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partiallyDecoded = decodeLast(ctx, e.getChannel(), replayable, state);
View Full Code Here

        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all data was read before notifying a closed channel.
                callDecode(ctx, e.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partiallyDecoded = decodeLast(ctx, e.getChannel(), replayable, state);
                    if (partiallyDecoded != null) {
                        unfoldAndfireMessageReceived(ctx, partiallyDecoded, null);
                    }
View Full Code Here

            ctx.sendUpstream(e);
            return;
        }

        ChannelBuffer input = (ChannelBuffer) m;
        if (!input.readable()) {
            return;
        }

        ChannelBuffer cumulation = cumulation(ctx);
        if (cumulation.readable()) {
View Full Code Here

        if (!input.readable()) {
            return;
        }

        ChannelBuffer cumulation = cumulation(ctx);
        if (cumulation.readable()) {
            cumulation.discardReadBytes();
            cumulation.writeBytes(input);
            callDecode(ctx, e.getChannel(), cumulation, e.getRemoteAddress());
        } else {
            callDecode(ctx, e.getChannel(), input, e.getRemoteAddress());
View Full Code Here

    private void cleanup(ChannelHandlerContext ctx, ChannelStateEvent e)
            throws Exception {
        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all frames are read before notifying a closed channel.
                callDecode(ctx, ctx.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partialFrame = decodeLast(ctx, ctx.getChannel(), cumulation);
View Full Code Here

        ChannelBuffer cumulation = cumulation(ctx);
        try {
            if (cumulation.readable()) {
                // Make sure all frames are read before notifying a closed channel.
                callDecode(ctx, ctx.getChannel(), cumulation, null);
                if (cumulation.readable()) {
                    // and send the remainders too if necessary.
                    Object partialFrame = decodeLast(ctx, ctx.getChannel(), cumulation);
                    if (partialFrame != null) {
                        fireMessageReceived(ctx, null, partialFrame);
                    }
View Full Code Here

            encodeInitialLine(header, request);
            encodeHeaders(header, request);
            header.writeBytes(CRLF);

            ChannelBuffer content = request.getContent();
            if (!content.readable()) {
                return header; // no content
            } else {
                return wrappedBuffer(header, content);
            }
        }
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.