Ejemplo n.º 1
0
        public int Parse(byte[] data, int dataIndex)
        {
            int bufferOffset = ParseHeaderData(data, dataIndex);
            Partitions = new List<FetchPartition>(PartitionCount);

            for (var i = 0; i < PartitionCount; i++)
            {
                int partitionId;
                short errorCode;
                bufferOffset = BufferReader.Read(data, bufferOffset, out partitionId);
                bufferOffset = BufferReader.Read(data, bufferOffset, out errorCode);
                var fetchPartition = new FetchPartition(partitionId, errorCode);
                Partitions.Add(fetchPartition);
                bufferOffset = fetchPartition.Parse(data, bufferOffset);
                if (bufferOffset >= data.Length)
                    break;
            }
            return bufferOffset;
        }
Ejemplo n.º 2
0
        public int Parse(byte[] data, int dataIndex)
        {
            int bufferOffset = ParseHeaderData(data, dataIndex);

            Partitions = new List <FetchPartition>(PartitionCount);

            for (var i = 0; i < PartitionCount; i++)
            {
                int   partitionId;
                short errorCode;
                bufferOffset = BufferReader.Read(data, bufferOffset, out partitionId);
                bufferOffset = BufferReader.Read(data, bufferOffset, out errorCode);
                var fetchPartition = new FetchPartition(partitionId, errorCode);
                Partitions.Add(fetchPartition);
                bufferOffset = fetchPartition.Parse(data, bufferOffset);
                if (bufferOffset >= data.Length)
                {
                    break;
                }
            }
            return(bufferOffset);
        }