Package io.netty.buffer

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


    {
        int readableBytes = in.readableBytes();
        byte[] heapIn = bufToByte( in );

        ByteBuf heapOut = ctx.alloc().heapBuffer( cipher.getOutputSize( readableBytes ) );
        heapOut.writerIndex( cipher.update( heapIn, 0, readableBytes, heapOut.array(), heapOut.arrayOffset() ) );

        return heapOut;
    }

    @Override
View Full Code Here


                                inPos = 0;
                            }

                            ByteBuf uncompressed = ctx.alloc().heapBuffer(originalLength, originalLength);
                            final byte[] outputArray = uncompressed.array();
                            final int outPos = uncompressed.arrayOffset() + uncompressed.writerIndex();

                            boolean success = false;
                            try {
                                decoder.decodeChunk(inputArray, inPos, outputArray, outPos, outPos + originalLength);
                                uncompressed.writerIndex(uncompressed.writerIndex() + originalLength);
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.