public static byte[] SerializeSet(IHashSetAccessor data, Func<object, byte[]> valueSerializer)
        {
            using (MemoryStream ms = new MemoryStream())
            {
                ms.WriteUShort((ushort)data.Count);
                foreach (object elem in data)
                {
                    Console.WriteLine(elem);
                    ms.WriteShortByteArray(valueSerializer(elem));                    
                }

                Console.WriteLine(ms.Length);

                return ms.ToArray();
            }
        }
        public static object DeserializeSet(byte[] rawData, IHashSetAccessor destSet, Func<byte[], object> valueDeserializer)
        {
            using (MemoryStream ms = new MemoryStream(rawData))
            {
                ushort nbElem = ms.ReadUShort();
                while (0 < nbElem)
                {
                    byte[] elemRawData = ms.ReadShortBytes();
                    object elem = valueDeserializer(elemRawData);
                    destSet.AddItem(elem);
                    --nbElem;
                }

                return destSet;
            }
        }