Package org.zper

Examples of org.zper.MsgIterator


    }

    private void check(ByteBuffer buf)
    {
        assert (size == buf.remaining());
        MsgIterator mi = new MsgIterator(buf.duplicate());

        int msgCount = 0;
        while (mi.hasNext()) {
            msgCount++;
            mi.next();
        }

        assert (count == msgCount);
        total.getAndAdd(count);
        System.out.println(total);
View Full Code Here


        if (status != 100) {
            // no more data
            return result;
        }

        MsgIterator it = ZPUtils.iterator(sock.base().recv(0), true);

        while (it.hasNext()) {
            Msg header = it.next();
            if (it.hasNext()) {
                Msg data = it.next();
                result.add(new Message(header.data(), data.data()));
            } else
                break;
        }
View Full Code Here

    }

    private byte[] getLastFrame(ByteBuffer buf)
    {
        buf.rewind();
        MsgIterator it = new MsgIterator(buf);
        it.hasNext();
        return it.next().data();
    }
View Full Code Here

            return results;
        }
        buf = entry.getValue().getBuffer(false);
        buf.position((int) (start - entry.getKey()));

        MsgIterator it = new MsgIterator(buf, conf.allow_empty_message);

        while (it.hasNext()) {
            msg = it.next();
            if (msg == null)
                break;
            max = max - msg.size();
            if (max <= 0)
                break;
View Full Code Here

            return count;
        }
        buf = entry.getValue().getBuffer(false);
        buf.position((int) (start - entry.getKey()));

        MsgIterator it = new MsgIterator(buf, conf.allow_empty_message);

        while (it.hasNext()) {
            msg = it.next();
            if (msg == null)
                break;
            max = max - msg.size();
            if (max <= 0)
                break;
View Full Code Here

                }
            }
            try {
                MappedByteBuffer buf = ch.map(MapMode.READ_ONLY, 0, ch.size());
                int pos = 0;
                MsgIterator it = new MsgIterator(buf, allowEmpty);
                while (it.hasNext()) {
                    Msg msg = it.next();
                    if (msg == null)
                        break;
                    pos = buf.position();
                }
View Full Code Here

TOP

Related Classes of org.zper.MsgIterator

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.