Package io.netty.buffer

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


                                case READING:
                                    int remaining = buffer.readableBytes();

                                    if (length > remaining) {
                                        length -= remaining;
                                        buffer.skipBytes(remaining);
                                    } else {
                                        buffer.skipBytes(length);
                                        ctx.writeAndFlush(new DatagramPacket(ACK.retain(1).resetReaderIndex(), message.sender()));
                                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                                        length = 0;
View Full Code Here


                                    if (length > remaining) {
                                        length -= remaining;
                                        buffer.skipBytes(remaining);
                                    } else {
                                        buffer.skipBytes(length);
                                        ctx.writeAndFlush(new DatagramPacket(ACK.retain(1).resetReaderIndex(), message.sender()));
                                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                                        length = 0;
                                    }
                            }
View Full Code Here

                case READING:
                    int remaining = buffer.readableBytes();

                    if (length > remaining) {
                        length -= remaining;
                        buffer.skipBytes(remaining);
                    } else {
                        buffer.skipBytes(length);
                        ctx.writeAndFlush(ACK.retain(1).resetReaderIndex());
                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                        length = 0;
View Full Code Here

                    if (length > remaining) {
                        length -= remaining;
                        buffer.skipBytes(remaining);
                    } else {
                        buffer.skipBytes(length);
                        ctx.writeAndFlush(ACK.retain(1).resetReaderIndex());
                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                        length = 0;
                    }
                }
View Full Code Here

            int resultCode;
            try {
                resultCode = z.deflate(JZlib.Z_SYNC_FLUSH);
            } finally {
                out.skipBytes(z.next_in_index - oldNextInIndex);
            }
            if (resultCode != JZlib.Z_OK) {
                throw new CompressionException("compression failure: " + resultCode);
            }
View Full Code Here

      catch (IOException e) {
        throw createCoercionException(val.getClass(), byte[].class);
      }

      // Skip written length
      buffer.skipBytes(4);

      return new ByteBufInputStream(buffer) {
        @Override
        public void close() throws IOException {
          super.close();
View Full Code Here

      catch (IOException e) {
        throw createCoercionException(val.getClass(), byte[].class);
      }

      // Skip written length
      buffer.skipBytes(4);

      byte[] array = new byte[buffer.readableBytes()];
      buffer.readBytes(array);
      return array;
    }
View Full Code Here

        if (packetLength == -1) {
            // Bad data - discard the buffer and raise an exception.
            NotSslRecordException e = new NotSslRecordException(
                    "not an SSL/TLS record: " + BufUtil.hexDump(in));
            in.skipBytes(in.readableBytes());
            ctx.fireExceptionCaught(e);
            setHandshakeFailure(e);
            return;
        }
View Full Code Here

    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        if (msg instanceof ByteBuf) {
            ByteBuf bb = (ByteBuf)msg;
            if (this.nrOfBytes > 0) {
                if (this.transferredBytes >= this.skipStartingPos) {
                    bb.skipBytes(this.nrOfBytes);
                    this.nrOfBytes = 0;
                }
                else {
                    this.skipStartingPos -= messageSize(msg);
                }
View Full Code Here

                case READING:
                    int remaining = buffer.readableBytes();

                    if (length > remaining) {
                        length -= remaining;
                        buffer.skipBytes(remaining);
                    } else {
                        buffer.skipBytes(length);
                        ctx.writeAndFlush(ACK.retain(1).resetReaderIndex());
                        state = State.WAIT_FOR_FIRST_BYTE_LENGTH;
                        length = 0;
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.