Exemple #1
0
        public static byte[] SaveStateAsByteArray(this MicroRatchetContext mr)
        {
            if (mr == null)
            {
                throw new ArgumentNullException(nameof(mr));
            }

            using var ms = new MemoryStream();
            mr.SaveState(ms);
            return(ms.ToArray());
        }
Exemple #2
0
 public static byte[] Send(this MicroRatchetContext mrc, byte[] payload, int offset, int length) =>
 mrc.Send(new ArraySegment <byte>(payload, offset, length));
Exemple #3
0
 public static byte[] Send(this MicroRatchetContext mrc, byte[] payload) =>
 mrc.Send(new ArraySegment <byte>(payload));