Пример #1
0
        // TODO: refactor codecs to work with IDictionary
        public static IList <KeyValuePair <Guid, IList <int> > > Decode(IEnumerator <Frame> iterator)
        {
            var ownerPartitionIds = ListMultiFrameCodec.Decode(iterator, ListIntegerCodec.Decode);
            var ownerIds          = ListUUIDCodec.Decode(iterator);

            return((ownerIds, ownerPartitionIds).Combine()
                   .Select(x => new KeyValuePair <Guid, IList <int> >(x.Item1, x.Item2))
                   .ToList());
        }
Пример #2
0
        public static IList <KeyValuePair <long, byte[]> > Decode(IEnumerator <Frame> iterator)
        {
            var listV = ListMultiFrameCodec.Decode(iterator, ByteArrayCodec.Decode);
            var listK = ListLongCodec.Decode(iterator);

            var result = new List <KeyValuePair <long, byte[]> >(listV.Count);

            for (var i = 0; i < listK.Count; i++)
            {
                result.Add(new KeyValuePair <long, byte[]>(listK[i], listV[i]));
            }

            return(result);
        }