protected override void Parse0(IoBuffer buf)
 {
     HermesPrimitiveCodec codec = new HermesPrimitiveCodec(buf);
     Topic = codec.ReadString();
     Partition = codec.ReadInt();
     GroupId = codec.ReadString();
 }
        public PartialDecodedMessage DecodePartial(IoBuffer buf)
        {
            HermesPrimitiveCodec codec = new HermesPrimitiveCodec(buf);

            // skip whole length
            codec.ReadInt();
            // skip header length
            int headerLen = codec.ReadInt();
            // skip body length
            int bodyLen = codec.ReadInt();
            verifyChecksum(buf, headerLen + bodyLen);
            PartialDecodedMessage msg = new PartialDecodedMessage();
            msg.Key = codec.ReadString();
            msg.BornTime = codec.ReadLong();
            msg.RemainingRetries = codec.ReadInt();
            msg.BodyCodecType = codec.ReadString();

            int len = codec.ReadInt();
            msg.DurableProperties = buf.GetSlice(len);

            len = codec.ReadInt();
            msg.VolatileProperties = buf.GetSlice(len);

            msg.Body = buf.GetSlice(bodyLen);

            // skip crc
            codec.ReadLong();

            return msg;
        }
 protected override void Parse0(IoBuffer buf)
 {
     Buf = buf;
     var codec = new HermesPrimitiveCodec(buf);
     msgCounter.WriteFullFence(codec.ReadInt());
     Topic = codec.ReadString();
     Partition = codec.ReadInt();
     
 }
        private void readBatchMetas(HermesPrimitiveCodec codec, List<TppConsumerMessageBatch> batches)
        {
            int batchSize = codec.ReadInt();
            for (int i = 0; i < batchSize; i++)
            {
                TppConsumerMessageBatch batch = new TppConsumerMessageBatch();
                int msgSize = codec.ReadInt();
                batch.Topic = codec.ReadString();
                batch.Partition = codec.ReadInt();
                batch.Priority = codec.ReadInt();
                batch.Resend = codec.ReadBoolean();

                for (int j = 0; j < msgSize; j++)
                {
                    batch.AddMessageMeta(new MessageMeta(codec.ReadLong(), codec.ReadInt(), codec.ReadLong(), codec.ReadInt(),
                            codec.ReadBoolean()));
                }
                batches.Add(batch);
            }
        }
        private ConcurrentDictionary<Triple<Tpp, string, bool>, List<AckContext>> readMsgSeqMap(HermesPrimitiveCodec codec)
        {
            ConcurrentDictionary<Triple<Tpp, string, bool>, List<AckContext>> msgSeqMap = new ConcurrentDictionary<Triple<Tpp, string, bool>, List<AckContext>>();

            int mapSize = codec.ReadInt();
            if (mapSize != 0)
            {
                List<Triple<Tpp, string, bool>> tppgrs = new List<Triple<Tpp, string, bool>>();
                for (int i = 0; i < mapSize; i++)
                {
                    Tpp tpp = new Tpp(codec.ReadString(), codec.ReadInt(), codec.ReadInt() == 0 ? true : false);
                    String groupId = codec.ReadString();
                    bool resend = codec.ReadBoolean();
                    tppgrs.Add(new Triple<Tpp, string, bool>(tpp, groupId, resend));
                }
                for (int i = 0; i < mapSize; i++)
                {
                    Triple<Tpp, string, bool> tppgr = tppgrs[i];

                    int len = codec.ReadInt();
                    if (len == 0)
                    {
                        msgSeqMap[tppgr] = new List<AckContext>();
                    }
                    else
                    {
                        msgSeqMap[tppgr] = new List<AckContext>(len);
                    }

                    for (int j = 0; j < len; j++)
                    {
                        msgSeqMap[tppgr].Add(new AckContext(codec.ReadLong(), codec.ReadInt(), codec.ReadLong(), codec.ReadLong()));
                    }
                }
            }

            return msgSeqMap;
        }