Example #1
0
        public IItemSerializer <ChromGroupHeaderInfo> ChromGroupHeaderInfoSerializer()
        {
            if (FormatVersion >= CacheFormatVersion.Five)
            {
                return(ChromGroupHeaderInfo.ItemSerializer(ChromGroupHeaderSize));
            }

            var v4Reader = ChromGroupHeaderInfo4.StructSerializer();

            return(ConvertedItemSerializer.Create(v4Reader, v4Header => new ChromGroupHeaderInfo(v4Header), header => new ChromGroupHeaderInfo4(header)));
        }
Example #2
0
 public IItemSerializer <ChromTransition> ChromTransitionSerializer()
 {
     if (FormatVersion > CacheFormatVersion.Six)
     {
         return(ChromTransition.StructSerializer(ChromTransitionSize));
     }
     if (FormatVersion > CacheFormatVersion.Four)
     {
         return(ConvertedItemSerializer.Create(
                    ChromTransition5.StructSerializer(),
                    chromTransition5 => new ChromTransition(chromTransition5),
                    chromTransition => new ChromTransition5(chromTransition)));
     }
     return(ConvertedItemSerializer.Create(ChromTransition4.StructSerializer(),
                                           chromTransition4 => new ChromTransition(chromTransition4),
                                           chromTransiton => new ChromTransition4(chromTransiton)));
 }