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); }
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); }