示例#1
0
        /**
         * <summary>
         * Package protected member to read the mesage from a DataOutput stream.
         * </summary>
         *
         * <param name="input">			The stream from which the data is to be read</param>
         * <param name="retrievebody">  A flag indicating the body of the message should
         *                              be retrieved.</param>
         *
         *
         * <exception cref="Exception"> In the case that the stream experiences an error
         *                              while reading data.</exception>
         */
        internal void Read(BinaryReader input, bool retrievebody)
        {
            // Make sure that if this object is being reused we don't over write the UUID
            (messageID = new UUID()).Read(input);
            messageClass    = (MessageClassEnum)input.ReadByte();
            messagePriority = (MessagePriorityEnum)input.ReadByte();

            byte[] tmp = input.ReadBytes(Safmq.MSGLBL_LENGTH);
            label = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp)));

            timeStamp         = input.ReadInt32();
            timeToLiveSeconds = input.ReadInt32();
            ttlErrorWanted    = input.ReadByte();

            tmp = input.ReadBytes(Safmq.QNAME_LENGTH);
            this.responseQueueName = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp)));

            // Make sure that if this object is being reused we don't over write the UUID
            (reciptID = new UUID()).Read(input);

            bodyType = (BodyTypeEnum)input.ReadByte();
            bodySize = input.ReadInt32();

            if (bodySize > 0)
            {
                body = new MemoryStream(input.ReadBytes(bodySize));
            }
        }
示例#2
0
        /**
         * <summary>
         * Package protected member to read the mesage from a DataOutput stream.
         * </summary>
         *
         * <param name="input">			The stream from which the data is to be read</param>
         * <param name="retrievebody">  A flag indicating the body of the message should
         * 							    be retrieved.</param>
         *
         *
         * <exception cref="Exception"> In the case that the stream experiences an error
         *      						while reading data.</exception>
         */
        internal void Read(BinaryReader input, bool retrievebody)
        {
            // Make sure that if this object is being reused we don't over write the UUID
            (messageID = new UUID()).Read(input);
            messageClass = (MessageClassEnum)input.ReadByte();
            messagePriority = (MessagePriorityEnum)input.ReadByte();

            byte[] tmp = input.ReadBytes(Safmq.MSGLBL_LENGTH);
            label = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp)));

            timeStamp = input.ReadInt32();
            timeToLiveSeconds = input.ReadInt32();
            ttlErrorWanted = input.ReadByte();

            tmp = input.ReadBytes(Safmq.QNAME_LENGTH);
            this.responseQueueName = new string(Encoding.UTF8.GetChars(tmp, 0, ioutil.length(tmp)));

            // Make sure that if this object is being reused we don't over write the UUID
            (reciptID = new UUID()).Read(input);

            bodyType = (BodyTypeEnum)input.ReadByte();
            bodySize = input.ReadInt32();

            if (bodySize > 0)
                body = new MemoryStream(input.ReadBytes(bodySize));
        }