Esempio n. 1
0
        public void Create(IntPtr data, int offset, int length, PacketFlags flags)
        {
            if (data == IntPtr.Zero)
            {
                throw new ArgumentNullException("data");
            }

            if (offset < 0 || length < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            nativePacket = Native.enet_packet_create_offset(data, (IntPtr)length, (IntPtr)offset, flags);
        }
Esempio n. 2
0
        public void Create(byte[] data, int offset, int length, PacketFlags flags)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            if (offset < 0)
            {
                throw new ArgumentOutOfRangeException("offset");
            }

            if (length < 0 || length > data.Length)
            {
                throw new ArgumentOutOfRangeException("length");
            }

            nativePacket = Native.enet_packet_create_offset(data, (IntPtr)length, (IntPtr)offset, flags);
        }