Examples of readerIndex()


Examples of com.alibaba.dubbo.remoting.buffer.ChannelBuffer.readerIndex()

                Object msg;
                int savedReadIndex;

                do {
                    savedReadIndex = frame.readerIndex();
                    try {
                        msg = codec.decode(channel, frame);
                    } catch (Exception e) {
                        previousData = ChannelBuffers.EMPTY_BUFFER;
                        throw new IOException(e.getMessage(), e);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.buffer.ChannelBuffer.readerIndex()

     * Stores the internal cumulative buffer's reader position.
     */
    protected void checkpoint() {
        ChannelBuffer cumulation = this.cumulation;
        if (cumulation != null) {
            checkpoint = cumulation.readerIndex();
        } else {
            checkpoint = -1; // buffer not available (already cleaned up)
        }
    }

View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        HttpResponse response = null;
       
        if (buffer != null) {
            response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(code), buffer);
            // We just need to reset the readerIndex this time
            if (buffer.readerIndex() == buffer.writerIndex()) {
                buffer.setIndex(0, buffer.writerIndex());
            }
            // TODO How to enable the chunk transport
            int len = buffer.readableBytes();
            // set content-length
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        ByteBuf line = readLine();
        if (line == null) {
            return false;
        }

        int space = line.indexOf(line.readerIndex(), line.readerIndex() + line.readableBytes(), (byte) ' ');
        if (space < 0) {
            setError(Error.INVALID_METHOD);
            return false;
        }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        ByteBuf line = readLine();
        if (line == null) {
            return false;
        }

        int space = line.indexOf(line.readerIndex(), line.readerIndex() + line.readableBytes(), (byte) ' ');
        if (space < 0) {
            setError(Error.INVALID_METHOD);
            return false;
        }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        if (space < 0) {
            setError(Error.INVALID_METHOD);
            return false;
        }

        int len = space - line.readerIndex();

        ByteBuf methodBuf = line.readSlice(len);

        String methodName = methodBuf.toString(UTF8);
        for (int i = 0; i < METHODS.length; ++i) {
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        if (line == null) {
            return false;
        }

        int space = line.indexOf(line.readerIndex(), line.readerIndex() + line.readableBytes(), (byte) ' ');

        if (space < 0) {
            setError(Error.INVALID_VERSION);
            return false;
        }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        if (line == null) {
            return false;
        }

        int space = line.indexOf(line.readerIndex(), line.readerIndex() + line.readableBytes(), (byte) ' ');

        if (space < 0) {
            setError(Error.INVALID_VERSION);
            return false;
        }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

        if (space < 0) {
            setError(Error.INVALID_VERSION);
            return false;
        }

        int len = space - line.readerIndex();

        ByteBuf versionBuf = line.readSlice(len);

        if (!readVersion(versionBuf)) {
            setError(Error.INVALID_VERSION);
View Full Code Here

Examples of io.netty.buffer.ByteBuf.readerIndex()

    }

    public static byte[] extractByteArray(JSObject object) {
        ByteBuf buf = extract( object );
        byte[] bytes = new byte[ bufLen( object ) ];
        buf.getBytes( buf.readerIndex(), bytes );
        return bytes;
    }

    public static int bufLen(JSObject obj) {
        return ((Number) obj.get( null, "length" )).intValue();
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.