System.Net.Topology.ByteArrayExtensions.Not C# (CSharp) 메소드

Not() 정적인 개인적인 메소드

static private Not ( this bits ) : byte[]
bits this
리턴 byte[]
        internal static byte[] Not(this byte[] bits)
        {
            if (bits == null)
                throw new ArgumentNullException(nameof(bits));

            if (bits.Length == 4)
            {
                var i = BitConverter.ToInt32(bits, 0);
                return BitConverter.GetBytes(~i);
            }
            var newBytes = new byte[bits.Length];
            for (int i = 0; i < newBytes.Length; ++i)
                newBytes[i] = unchecked((byte)(~bits[i]));
            return newBytes;
        }