Package org.jboss.netty.buffer

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


    body.markReaderIndex();

    inputSupplier = new InputSupplier<InputStream>() {
      @Override
      public InputStream getInput() throws IOException {
        body.resetReaderIndex();
        return new ChannelBufferInputStream(body);
      }
    };
  }
View Full Code Here


                                                    TApplicationException.INTERNAL_ERROR,
                                                    "Task timed out while executing."
                                            );
                                            // Create a temporary transport to send the exception
                                            ChannelBuffer duplicateBuffer = message.getBuffer().duplicate();
                                            duplicateBuffer.resetReaderIndex();
                                            TNiftyTransport temporaryTransport = new TNiftyTransport(
                                                    ctx.getChannel(),
                                                    duplicateBuffer,
                                                    message.getTransportType());
                                            TProtocolPair protocolPair = duplexProtocolFactory.getProtocolPair(
View Full Code Here

    body.markReaderIndex();

    inputSupplier = new InputSupplier<InputStream>() {
      @Override
      public InputStream getInput() throws IOException {
        body.resetReaderIndex();
        return new ChannelBufferInputStream(body);
      }
    };
  }
View Full Code Here

    final ChannelBuffer responseContent = content.duplicate();    // Have independent pointers.
    responseContent.markReaderIndex();
    return new InputSupplier<InputStream>() {
      @Override
      public InputStream getInput() throws IOException {
        responseContent.resetReaderIndex();
        return new ChannelBufferInputStream(responseContent);
      }
    };
  }
}
View Full Code Here

                                                TApplicationException.INTERNAL_ERROR,
                                                "Task timed out while executing."
                                        );
                                        // Create a temporary transport to send the exception
                                        ChannelBuffer duplicateBuffer = message.getBuffer().duplicate();
                                        duplicateBuffer.resetReaderIndex();
                                        TNiftyTransport temporaryTransport = new TNiftyTransport(
                                                ctx.getChannel(),
                                                duplicateBuffer,
                                                message.getTransportType());
                                        TProtocolPair protocolPair = duplexProtocolFactory.getProtocolPair(
View Full Code Here

                            buffer.readableBytes() - 4);
                    buffer.markReaderIndex();
                    buffer.readerIndex(buffer.writerIndex() - 4);
                    int checksum = buffer.readInt();
                    if (checksum == (int)adler32.getValue()) {
                        buffer.resetReaderIndex();
                        RpcMessage message = RpcMessage.newBuilder().mergeFrom(
                                buffer.array(),
                                buffer.arrayOffset() + buffer.readerIndex() + 4,
                                buffer.readableBytes() - 8).build();
                        return message;
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.