Package org.jboss.netty.buffer

Examples of org.jboss.netty.buffer.ChannelBufferInputStream


        {
           headers = NettyUtil.extractHttpHeaders(request);

           uriInfo = NettyUtil.extractUriInfo(request, servletMappingPrefix, proto);
           HttpRequest nettyRequest = new NettyHttpRequest(headers, uriInfo, request.getMethod().getName(), dispatcher, response, org.jboss.netty.handler.codec.http.HttpHeaders.is100ContinueExpected(request) );
           ChannelBufferInputStream is = new ChannelBufferInputStream(request.getContent());
           nettyRequest.setInputStream(is);
           return nettyRequest;
        }
        catch (Exception e)
        {
View Full Code Here


                body = new ByteArrayInputStream(new byte[0]);
            }

        } else {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            IOUtils.copy(new ChannelBufferInputStream(b), out);
            byte[] n = out.toByteArray();
            body = new ByteArrayInputStream(n);
        }

        String host = nettyRequest.getHeader(HOST);
View Full Code Here

            // Merge the received chunk into the content of the current message.
            final HttpChunk chunk = (HttpChunk) msg;
            if (maxContentLength != -1 && (localFile.length() > (maxContentLength - chunk.getContent().readableBytes()))) {
                currentMessage.setHeader(HttpHeaders.Names.WARNING, "play.netty.content.length.exceeded");
            } else {
                IOUtils.copyLarge(new ChannelBufferInputStream(chunk.getContent()), this.out);

                if (chunk.isLast()) {
                    this.out.flush();
                    this.out.close();
View Full Code Here

          headers.setObjectForKey(new NSArray<String>(header.getValue().split(",")), header.getKey());
        }
       
        // content
        ChannelBuffer _content = request.getContent();
    NSData contentData = (_content.readable()) ? new WOInputStreamData(new NSData(new ChannelBufferInputStream(_content), 4096)) : NSData.EmptyData;         
   
    // create request
    WORequest _worequest = WOApplication.application().createRequest(
        request.getMethod().getName(),
        request.getUri(),
View Full Code Here

    }

    @Override
    protected Object decode(
            ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer, CompatibleObjectDecoderState state) throws Exception {
        bin.switchStream(new ChannelBufferInputStream(buffer));
        switch (state) {
        case READ_HEADER:
            oin = newObjectInputStream(bin);
            checkpoint(CompatibleObjectDecoderState.READ_OBJECT);
        case READ_OBJECT:
View Full Code Here

        if (frame == null) {
            return null;
        }

        return new CompactObjectInputStream(
                new ChannelBufferInputStream(frame), classResolver).readObject();
    }
View Full Code Here

                        buf.array(), buf.arrayOffset() + offset, buf.readableBytes(), extensionRegistry).build();
            }
        } else {
            if (extensionRegistry == null) {
                return prototype.newBuilderForType().mergeFrom(
                        new ChannelBufferInputStream((ChannelBuffer) msg)).build();
            } else {
                return prototype.newBuilderForType().mergeFrom(
                        new ChannelBufferInputStream((ChannelBuffer) msg), extensionRegistry).build();
            }
        }
    }
View Full Code Here

            return msg;
        }

        if (extensionRegistry == null) {
            return prototype.newBuilderForType().mergeFrom(
                    new ChannelBufferInputStream((ChannelBuffer) msg)).build();
        } else {
            return prototype.newBuilderForType().mergeFrom(
                    new ChannelBufferInputStream((ChannelBuffer) msg),
                    extensionRegistry).build();
        }
    }
View Full Code Here

            // Merge the received chunk into the content of the current message.
            final HttpChunk chunk = (HttpChunk) msg;
            if (maxContentLength != -1 && (localFile.length() > (maxContentLength - chunk.getContent().readableBytes()))) {
                currentMessage.setHeader(HttpHeaders.Names.WARNING, "yalp.netty.content.length.exceeded");
            } else {
                IOUtils.copyLarge(new ChannelBufferInputStream(chunk.getContent()), this.out);

                if (chunk.isLast()) {
                    this.out.flush();
                    this.out.close();
View Full Code Here

                body = new ByteArrayInputStream(new byte[0]);
            }

        } else {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            IOUtils.copy(new ChannelBufferInputStream(b), out);
            byte[] n = out.toByteArray();
            body = new ByteArrayInputStream(n);
        }

        String host = nettyRequest.getHeader(HOST);
View Full Code Here

TOP

Related Classes of org.jboss.netty.buffer.ChannelBufferInputStream

Copyright © 2018 www.massapicom. 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.