Beispiel #1
0
        public byte[] ToArray()
        {
            var woffset = 0;
            var ret     = new byte[Size];

            ret.CopyAndIncr(BitConverter.GetBytes(Time), ref woffset);
            ret.CopyAndIncr(BitConverter.GetBytes(Services), ref woffset);
            ret.CopyAndIncr(Ip.MapToIPv6().GetAddressBytes(), ref woffset);
            ret.CopyAndIncr(BitConverter.GetBytes(Port), woffset);


            return(ret);
        }
Beispiel #2
0
        public byte[] ToArray()
        {
            var ret = new byte[Size];

            var t = BitConverter.GetBytes(Time);

            Buffer.BlockCopy(t, 0, ret, 0, t.Length);

            var s = BitConverter.GetBytes(Services);

            Buffer.BlockCopy(s, 0, ret, 4, s.Length);

            var i = Ip.MapToIPv6().GetAddressBytes();

            Buffer.BlockCopy(i, 0, ret, 12, i.Length);

            var p = BitConverter.GetBytes(Port);

            Buffer.BlockCopy(p, 0, ret, 28, p.Length);

            return(ret);
        }