Package org.apache.mina.http.api

Examples of org.apache.mina.http.api.HttpContentChunk


            ByteBuffer content = ByteBuffer.wrap(strContent.getBytes());

            // compute content len
            headers.put("Content-Length", String.valueOf(content.remaining()));
            session.write(new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SUCCESS_OK, headers));
            session.write(new HttpContentChunk(content));
            session.write(new HttpEndOfContent());
            session.close(false);

        }
View Full Code Here


            return null;
        case BODY:
            LOG.debug("decoding BODY");
            int chunkSize = msg.remaining();
            // send the chunk of body
            HttpContentChunk chunk = new HttpContentChunk(msg);
            // do we have reach end of body ?
            context.setRemainingBytes(context.getRemainingBytes() - chunkSize);

            if (context.getRemainingBytes() <= 0) {
                LOG.debug("end of HTTP body");
View Full Code Here

TOP

Related Classes of org.apache.mina.http.api.HttpContentChunk

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.