System.Text.SBCSCodePageEncoding.ZeroMemAligned C# (CSharp) Метод

ZeroMemAligned() приватный статический Метод

private static ZeroMemAligned ( byte buffer, int count ) : void
buffer byte
count int
Результат void
        private static unsafe void ZeroMemAligned(byte* buffer, int count)
        {
            long* pLong = (long*)buffer;
            long* pLongEnd = (long*)(buffer + count - sizeof(long));

            while (pLong < pLongEnd)
            {
                *pLong = 0;
                pLong++;
            }

            byte* pByte = (byte*)pLong;
            byte* pEnd = buffer + count;

            while (pByte < pEnd)
            {
                *pByte = 0;
                pByte++;
            }
        }