Package org.jboss.netty.buffer

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


                        } else {
                            LOG.debug("Processed queue - bytes remaining");
                        }
                    } else {
                        cnxn.receiveMessage(buf);
                        if (buf.readable()) {
                            if (LOG.isTraceEnabled()) {
                                LOG.trace("Before copy " + buf);
                            }
                            cnxn.queuedBuffer = dynamicBuffer(buf.readableBytes());
                            cnxn.queuedBuffer.writeBytes(buf);
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

            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

            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

                    .getStatus().toString());
        }

        ChannelBuffer content = httpResponse.getContent();

        if (!content.readable()) {
            return null;
        }

        return 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.