Package org.apache.qpid.transport.codec

Examples of org.apache.qpid.transport.codec.BBEncoder.segment()


        }
        else if (message instanceof BytesMessage)
        {
            BBEncoder encoder = new BBEncoder(1024);
            encoder.writeList(list);
            ByteBuffer buf = encoder.segment();
            byte[] data = new byte[buf.limit()];
            buf.get(data);
            ((BytesMessage)message).writeBytes(data);
        }
        else
View Full Code Here


    @ Override
    protected void writeMapToData()
    {
        BBEncoder encoder = new BBEncoder(1024);
        encoder.writeMap(_map);
        _data = ByteBuffer.wrap(encoder.segment());
    }
   
    // for testing
    Map<String,Object> getMap()
    {
View Full Code Here

            {
                enc.writeUint16(0x0100);
            }
        }
        method.write(enc);
        ByteBuffer methodSeg = enc.segment();

        byte flags = FIRST_SEG;

        boolean payload = method.hasPayload();
        if (!payload)
View Full Code Here

            for (Struct st : structs)
            {
                enc.writeStruct32(st);
            }
            headerSeg = enc.segment();
        }

        synchronized (sendlock)
        {
            fragment(flags, type, method, methodSeg);
View Full Code Here

            {
                enc.writeUint16(0x0100);
            }
        }
        method.write(enc);
        ByteBuffer methodSeg = enc.segment();

        byte flags = FIRST_SEG;

        boolean payload = method.hasPayload();
        if (!payload)
View Full Code Here

                for (Struct st : structs)
                {
                    enc.writeStruct32(st);
                }
            }
            headerSeg = enc.segment();
        }

        synchronized (sendlock)
        {
            fragment(flags, type, method, methodSeg);
View Full Code Here

    @ Override
    public ByteBuffer getData()
    {
        BBEncoder encoder = new BBEncoder(1024);
        encoder.writeMap(getMap());
        return encoder.segment();
    }
   
    @ Override
    protected void populateMapFromData(ByteBuffer data) throws JMSException
    {
View Full Code Here

    public ByteBuffer getData() throws JMSException
    {
        BBEncoder encoder = new BBEncoder(1024);
        encoder.writeList(_list);
        return encoder.segment();
    }

    public void setList(List<Object> l)
    {
        _list = l;
View Full Code Here

            {
                enc.writeUint16(0x0100);
            }
        }
        method.write(enc);
        ByteBuffer methodSeg = enc.segment();

        byte flags = FIRST_SEG;

        boolean payload = method.hasPayload();
        if (!payload)
View Full Code Here

                for (Struct st : structs)
                {
                    enc.writeStruct32(st);
                }
            }
            headerSeg = enc.segment();
        }

        synchronized (sendlock)
        {
            fragment(flags, type, method, methodSeg);
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.