Examples of discardReadBytes()


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

        buffer.skipBytes(2);
        final int packedDataSize = buffer.readShort() - 4;
        buffer.skipBytes(4);

        if (buffer.readableBytes() < packedDataSize) {
            buffer.discardReadBytes();
            return null;
        }

        try (InputStream stream = new ChannelBufferInputStream(buffer, packedDataSize)) {
            return packetType.makeObject(new InflaterInputStream(stream));
View Full Code Here

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

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

        ChannelBuffer cumulation = cumulation(ctx);
        cumulation.discardReadBytes();
        cumulation.writeBytes(input);
        callDecode(ctx, e.getChannel(), cumulation, e.getRemoteAddress());
    }

    @Override
View Full Code Here

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

            writtenObjects ++;
            if (writtenObjects % resetInterval == 0) {
                oout.reset();

                // Also discard the byproduct to avoid OOM on the sending side.
                buffer.discardReadBytes();
            }
        }
        oout.writeObject(msg);
        oout.flush();
View Full Code Here

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

            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());
            if (input.readable()) {
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.