private T GetValue <T> (FlattenedSerializationReader <T> reader) { try { return(reader.ReadValue()); } catch (InvalidOperationException ex) { throw new SerializationException(typeof(T).Name + " stream: " + ex.Message, ex); } }
public FlattenedDeserializationInfo(object[] data) { ArgumentUtility.CheckNotNull("data", data); object[] objects = ArgumentUtility.CheckType <object[]> ("data[0]", data[0]); int[] ints = ArgumentUtility.CheckType <int[]> ("data[1]", data[1]); bool[] bools = ArgumentUtility.CheckType <bool[]> ("data[2]", data[2]); _objectReader = new FlattenedSerializationReader <object> (objects); _intReader = new FlattenedSerializationReader <int> (ints); _boolReader = new FlattenedSerializationReader <bool> (bools); }