Exemple #1
0
        public T Deserialize <T>(byte[] bytes, ref int currentArrayIndex)
            where T : class, IMessageSerializable
        {
            DeserializeResults <T> results = DeserializeEx <T>(bytes, ref currentArrayIndex, false);

            return(results.Object);
        }
Exemple #2
0
        public virtual DeserializeResults <T> Deserialize <T>(byte[] bytes, ref int currentArrayIndex, bool suppressExceptions) where T : class, IMessageSerializable
        {
            DeserializeResults <T> results = new DeserializeResults <T>();

            try
            {
                results.Object = (T)Deserialize(bytes, ref currentArrayIndex, results.Status);
            }
            catch (Exception ex)
            {
                if (suppressExceptions)
                {
                    results.Status.Exception = ex;
                }
                else
                {
                    throw;
                }
            }

            return(results);
        }