Package org.apache.qpid.amqp_1_0.type

Examples of org.apache.qpid.amqp_1_0.type.Binary


        int read = fis.read(data);

        fis.close();

        Section applicationProperties = new ApplicationProperties(Collections.singletonMap("filename", fileName));
        Section amqpValue = new Data(new Binary(data));
        Message message = new Message(Arrays.asList(applicationProperties, amqpValue));
        Binary deliveryTag = new Binary(md5.digest(fileName.getBytes()));
        message.setDeliveryTag(deliveryTag);
        md5.reset();
        return message;
    }
View Full Code Here


    protected BytesMessageImpl(Header header, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties appProperties, Data data,
                               Footer footer, SessionImpl session)
    {
        super(header, messageAnnotations, properties, appProperties, footer, session);
        _dataIn = data;
        final Binary dataBuffer = data.getValue();
        _dataAsInput = new DataInputStream(new ByteArrayInputStream(dataBuffer.getArray(),dataBuffer.getArrayOffset(),dataBuffer.getLength()));

    }
View Full Code Here

    private Data getDataSection()
    {
        if(_bytesOut != null)
        {
            return new Data(new Binary(_bytesOut.toByteArray()));
        }
        else
        {
            return _dataIn;
        }
View Full Code Here

    public void reset() throws JMSException
    {
        if(_bytesOut != null)
        {
            byte[] data = _bytesOut.toByteArray();
            _dataIn = new Data(new Binary(data));
            _dataAsInput = new DataInputStream(new ByteArrayInputStream(data));
            _dataAsOutput = null;
            _bytesOut = null;
        }
        else
        {

            final Binary dataBuffer = _dataIn.getValue();
            _dataAsInput = new DataInputStream(new ByteArrayInputStream(dataBuffer.getArray(),dataBuffer.getArrayOffset(),dataBuffer.getLength()));

        }
    }
View Full Code Here

            {
                return -1;
            }
            throw new MessageFormatException("Cannot convert value of type " + obj.getClass().getName());
        }
        Binary binary = (Binary) obj;
        if(bytes.length >= binary.getLength())
        {
            System.arraycopy(binary.getArray(),binary.getArrayOffset(),bytes,0,binary.getLength());
            return binary.getLength();
        }
        return -1;
    }
View Full Code Here

    {
        checkWritable();
       
        if(!_list.isEmpty() && _list.get(_list.size()-1) instanceof byte[])
        {
            Binary oldVal = (Binary) _list.get(_list.size()-1);
            byte[] allBytes = new byte[oldVal.getLength() + size];
            System.arraycopy(oldVal.getArray(),oldVal.getArrayOffset(),allBytes,0,oldVal.getLength());
            System.arraycopy(bytes, offset, allBytes, oldVal.getLength(), size);
            _list.set(_list.size()-1, allBytes);
        }
        else
        {
            byte[] dup = new byte[size];
            System.arraycopy(bytes,offset,dup,0,size);
            _list.add(new Binary(dup));
        }
    }
View Full Code Here

    {

        Object o = getCorrelationId();
        if(o instanceof Binary)
        {
            Binary correlationIdBinary = (Binary) o;
            byte[] correlationId = new byte[correlationIdBinary.getLength()];
            correlationIdBinary.asByteBuffer().get(correlationId);
            return correlationId;
        }
        else
        {
            return o == null ? null : o.toString().getBytes();
View Full Code Here

        }
        else
        {
            byte[] dup = new byte[correlationId.length];
            System.arraycopy(correlationId,0,dup,0,correlationId.length);
            setCorrelationId(new Binary(dup));
        }
    }
View Full Code Here

    public String getJMSCorrelationID() throws JMSException
    {
        Object o = getProperties().getCorrelationId();
        if(o instanceof Binary)
        {
            Binary id = (Binary) o;
            return new String(id.getArray(), id.getArrayOffset(), id.getLength());
        }
        else
        {
            return o == null ? null : o.toString();
        }
View Full Code Here

            if(RAW_LOGGER.isLoggable(Level.FINE))
            {
                ByteBuffer dup = msg.duplicate();
                byte[] data = new byte[dup.remaining()];
                dup.get(data);
                Binary bin = new Binary(data);
                RAW_LOGGER.fine("RECV[" + getRemoteAddress() + "] : " + bin.toString());
            }
            _readBytes += msg.remaining();
            switch(_state)
            {
                case A:
View Full Code Here

TOP

Related Classes of org.apache.qpid.amqp_1_0.type.Binary

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.