internal static MalockNnsMessage Deserialize(Stream stream) { if (stream == null) { throw new ArgumentNullException("stream"); } BinaryReader br = new BinaryReader(stream); var m = new MalockNnsMessage(); if (!MalockMessage.DeserializeTo(m, br)) { return(null); } string s; if (!MalockMessage.TryFromStringInReadStream(br, out s)) { return(null); } m.Key = s; if (!MalockMessage.TryFromStringInReadStream(br, out s)) { return(null); } m.Identity = s; return(m); }
internal static bool TryDeserialize(Stream stream, out MalockNnsMessage message) { message = Deserialize(stream); return(message != null); }