Beispiel #1
0
        internal static MalockNodeMessage Deserialize(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            BinaryReader      br = new BinaryReader(stream);
            MalockNodeMessage m  = new MalockNodeMessage();

            if (!MalockMessage.DeserializeTo(m, br))
            {
                return(null);
            }
            m.Timeout = br.ReadInt32();
            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);
        }
Beispiel #2
0
        internal static string FromStringInReadStream(BinaryReader reader)
        {
            string s;

            if (!MalockMessage.TryFromStringInReadStream(reader, out s))
            {
                throw new EndOfStreamException();
            }
            return(s);
        }