Package org.apache.tomcat.lite.io

Examples of org.apache.tomcat.lite.io.BBucket.remaining()


                    received(body, sb);
                    //log.info("Queue received buffer " + this + " " + lenToConsume);
                    bodys.remaining = 0;
                } else {
                    BBucket first = rawReceiveBuffers.popFirst();
                    bodys.remaining -= first.remaining();
                    received(body, first);
                    //log.info("Queue full received buffer " + this + " RAW: " + rawReceiveBuffers);
                }
                if (bodys.contentLength >= 0 && bodys.remaining == 0) {
                    // Content-Length, all done
View Full Code Here


        while (true) {
            BBucket bucket = body.peekFirst();
            if (bucket == null) {
                break;
            }
            int len = bucket.remaining();
            if (len <= bodys.remaining) {
                bodys.remaining -= len;
                bucket = body.popFirst();
                out.queue(bucket);
            } else {
View Full Code Here

            ByteBuffer sendChunkBuffer = chunk.prepareChunkHeader(len);
            bodys.remaining = len;
            out.queue(sendChunkBuffer);
            while (bodys.remaining > 0) {
                BBucket bc = body.popFirst();
                bodys.remaining -= bc.remaining();
                out.queue(bc);
            }
        }

        if (body.isClosedAndEmpty()) {
View Full Code Here

        BBucket bb = in.peekFirst();

        while (bb != null && len > 0) {
            dStream.next_in = bb.array();
            dStream.next_in_index = bb.position();
            int rd = Math.min(bb.remaining(), len);
            dStream.avail_in = rd;

            while (true) {
                ByteBuffer outB = out.getWriteBuffer();
View Full Code Here

                if (bb == null) {
                    // we should have all data
                    abort("Unexpected short read");
                    return;
                }
                if (len > bb.remaining()) {
                    ch.getIn().append(bb);
                    len -= bb.remaining();
                    bb.position(bb.limit());
                } else {
                    ch.getIn().append(bb, len);
View Full Code Here

                    abort("Unexpected short read");
                    return;
                }
                if (len > bb.remaining()) {
                    ch.getIn().append(bb);
                    len -= bb.remaining();
                    bb.position(bb.limit());
                } else {
                    ch.getIn().append(bb, len);
                    bb.position(bb.position() + len);
                    len = 0;
View Full Code Here

                return -1;
            } else {
                System.err.println("Spurious waitData signal, no data");
            }
        }
        chunk.append(next.array(), next.position(), next.remaining());
        int read =  next.remaining();
        next.release();
        return read;
    }
View Full Code Here

            } else {
                System.err.println("Spurious waitData signal, no data");
            }
        }
        chunk.append(next.array(), next.position(), next.remaining());
        int read =  next.remaining();
        next.release();
        return read;
    }

    public HttpConnector getConnector() {
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.