Java Code Examples for

The following are Jave code examples for showing how to use read() of the class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: aws-sdk-java-v2   File:   Source Code and License Vote up 4 votes
protected void channelRead0(ChannelHandlerContext channelContext, HttpObject msg) throws Exception {
    RequestContext requestContext =;

    if (msg instanceof HttpResponse) {
        HttpResponse response = (HttpResponse) msg;
        SdkHttpResponse sdkResponse = SdkHttpFullResponse.builder()

    if (msg instanceof StreamedHttpResponse) {
        requestContext.handler().onStream(new PublisherAdapter((StreamedHttpResponse) msg, channelContext, requestContext));
    } else if (msg instanceof FullHttpResponse) {
        // TODO: HttpStreamsClientHandler leaves a dangling LastHttpContent
        // in the pipeline. Consume it ourselves to make sure the channel
        // is empty at the end of stream and before releasing it back to he
        // pool.  The HttpStreamsClientHandler should really be doing this
        // for us.;

        ByteBuf fullContent = ((FullHttpResponse) msg).content();
        final ByteBuffer bb = copyToByteBuffer(fullContent);
        requestContext.handler().onStream(new FullResponseContentPublisher(channelContext, bb));
        Subscriber<? super ByteBuffer> subscriber =;
        try {
        } catch (RuntimeException e) {
            throw e;
        } finally {
            finalizeRequest(requestContext, channelContext);
Example 2
Project: CustomWorldGen   File:   Source Code and License Vote up 4 votes
public void read(ChannelHandlerContext ctx) throws Exception
Example 3
Project: cardea   File:   Source Code and License Vote up 4 votes
public void channelActive(ChannelHandlerContext ctx) {;