示例#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());
        }
示例#2
0
 public static byte[] Send(this MicroRatchetContext mrc, byte[] payload, int offset, int length) =>
 mrc.Send(new ArraySegment <byte>(payload, offset, length));
示例#3
0
 public static byte[] Send(this MicroRatchetContext mrc, byte[] payload) =>
 mrc.Send(new ArraySegment <byte>(payload));