Examples of writerIndex()


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

        request.setData(person);
       
        codec.encode(channel, encodeBuffer, request);

        //encode resault check need decode
        byte[] data = new byte[encodeBuffer.writerIndex()];
        encodeBuffer.readBytes(data);
        ChannelBuffer decodeBuffer = ChannelBuffers.wrappedBuffer(data);
        Request obj = (Request)codec.decode(channel, decodeBuffer);
        Assert.assertEquals(request.isBroken(), obj.isBroken());
        Assert.assertEquals(request.isHeartbeat(), obj.isHeartbeat());
View Full Code Here

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

        marshaller.writeObject(msg);
        marshaller.finish();
        marshaller.close();

        ChannelBuffer encoded = output.getBuffer();
        encoded.setInt(0, encoded.writerIndex() - 4);

        return encoded;
    }

}
View Full Code Here

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

        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.writerIndex()

       
        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
            response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, len);
View Full Code Here

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

        }
        ByteBuf b = extract(obj);
        for ( int i = offset; i < end; ++i ) {
            b.setByte( i, byteVal );
        }
        b.writerIndex( Math.max( b.writerIndex(), offset + end ) );
        return obj;
    }

    public static long copy(JSObject src, JSObject target, int targetStart, int sourceStart, int sourceEnd) {
View Full Code Here

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

        }
        ByteBuf b = extract(obj);
        for ( int i = offset; i < end; ++i ) {
            b.setByte( i, byteVal );
        }
        b.writerIndex( Math.max( b.writerIndex(), offset + end ) );
        return obj;
    }

    public static long copy(JSObject src, JSObject target, int targetStart, int sourceStart, int sourceEnd) {
View Full Code Here

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

    public static long copy(JSObject src, JSObject target, int targetStart, int sourceStart, int sourceEnd) {

        ByteBuf srcBuf = extract(src);
        ByteBuf targetBuf = extract(target);

        int origWriter = targetBuf.writerIndex();

        targetBuf.writerIndex( targetStart );

        int len = sourceEnd - sourceStart;
View Full Code Here

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

        ByteBuf srcBuf = extract(src);
        ByteBuf targetBuf = extract(target);

        int origWriter = targetBuf.writerIndex();

        targetBuf.writerIndex( targetStart );

        int len = sourceEnd - sourceStart;

        len = Math.min( len, bufLen( target ) - targetStart );
View Full Code Here

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

        int len = sourceEnd - sourceStart;

        len = Math.min( len, bufLen( target ) - targetStart );

        targetBuf.writeBytes(srcBuf, sourceStart, len);
        targetBuf.writerIndex(Math.max(targetBuf.writerIndex(), origWriter));

        return len;
    }

View Full Code Here

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

        int len = sourceEnd - sourceStart;

        len = Math.min( len, bufLen( target ) - targetStart );

        targetBuf.writeBytes(srcBuf, sourceStart, len);
        targetBuf.writerIndex(Math.max(targetBuf.writerIndex(), origWriter));

        return len;
    }

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.