Package org.restlet.engine.io

Examples of org.restlet.engine.io.ReadableSelectionChannel


        boolean connectionClose = HeaderUtils.isConnectionClose(headers);

        // Create the representation
        if ((contentLength != Representation.UNKNOWN_SIZE && contentLength != 0)
                || chunkedEncoding || connectionClose) {
            ReadableSelectionChannel inboundEntityChannel = null;

            if (chunkedEncoding) {
                // Wraps the remaining bytes into a special buffer channel
                inboundEntityChannel = new ReadableChunkedChannel(this,
                        getBuffer(), getConnection()
                                .getReadableSelectionChannel());
            } else {
                // Wrap the buffer channel to control its announced size
                inboundEntityChannel = new ReadableSizedSelectionChannel(this,
                        getBuffer(), getConnection()
                                .getReadableSelectionChannel(), contentLength);
            }

            setEntityRegistration(inboundEntityChannel.getRegistration());

            if (inboundEntityChannel != null) {
                result = new ReadableRepresentation(inboundEntityChannel, null,
                        contentLength);
                result.setSize(contentLength);
View Full Code Here

TOP

Related Classes of org.restlet.engine.io.ReadableSelectionChannel

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.