Exemple #1
0
        public virtual HiEvent Serialize(ArraySegment <byte> bytes)
        {
            Ensure.IsNotNull(bytes.Array);

            var result = new HiEvent();

            string value = Encoding.UTF8.GetString(bytes.Array, bytes.Offset, bytes.Count);

            result = JsonConvert.DeserializeObject <HiEvent>(value);

            return(result);
        }
Exemple #2
0
        public virtual HiEvent Serialize(byte[] bytes)
        {
            Ensure.IsNotNull(bytes);

            var result = new HiEvent();

            string value = Encoding.UTF8.GetString(bytes);

            result = JsonConvert.DeserializeObject <HiEvent>(value);

            return(result);
        }